Advertisement
Guest User

CustomScore.java

a guest
Apr 22nd, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.06 KB | None | 0 0
  1. package com.meccascoreboard.rpghud;
  2.  
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.scoreboard.Objective;
  5. import org.bukkit.scoreboard.Score;
  6.  
  7. import java.util.ArrayList;
  8. import java.util.List;
  9.  
  10. /**
  11.  * Created by TheAwesomeGem on 4/5/2015.
  12.  */
  13. public class CustomScore
  14. {
  15.     public String Name;
  16.     public String Value;
  17.     public String Suffix;
  18.     public ChatColor NameCol;
  19.     public ChatColor ValCol;
  20.     public int Slot;
  21.  
  22.     public CustomScore(String name, String value, String suffix, ChatColor nameColor, ChatColor valCol, int slot)
  23.     {
  24.         Name = name;
  25.         Value = value;
  26.         Suffix = suffix;
  27.         NameCol = nameColor;
  28.         ValCol = valCol;
  29.         Slot = slot + 1;
  30.     }
  31.  
  32.     public void setScore(Objective objective)
  33.     {
  34.         List<Score> scores = new ArrayList<>();
  35.         scores.add(0, objective.getScore(NameCol + Name + Suffix + "      "));
  36.         scores.add(1, objective.getScore(ValCol + Value + "      "));
  37.  
  38.         scores.get(1).setScore(Slot - 1);
  39.         scores.get(0).setScore(Slot);
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement