Esempio n. 1
0
 public void switchClass(SkillClass skillClass) {
   DatabaseUtil.saveClass(id, getUserSkillClass());
   setUserSkillClass(DatabaseUtil.loadUserClass(id, skillClass));
   if (board.getObjective(ChatColor.AQUA + userSkillClass.getSkillClass().getName()) != null) {
     boardClass = board.getObjective(ChatColor.AQUA + userSkillClass.getSkillClass().getName());
   } else {
     boardClass =
         board.registerNewObjective(
             ChatColor.AQUA + userSkillClass.getSkillClass().getName(), "dummy");
   }
   scoreboard();
 }
Esempio n. 2
0
 public User(UUID id) {
   this.player = Bukkit.getPlayer(id);
   this.id = id;
   loadData();
   boardClass =
       board.registerNewObjective(
           ChatColor.AQUA + userSkillClass.getSkillClass().getName(), "dummy");
 }
Esempio n. 3
0
 public void scoreboard() {
   boardClass.setDisplaySlot(DisplaySlot.SIDEBAR);
   Score rank = boardClass.getScore(ChatColor.GREEN + "Rank:");
   Score power = boardClass.getScore(ChatColor.GOLD + "Power:");
   rank.setScore(userSkillClass.getRank());
   power.setScore(userSkillClass.getPower());
   Score[] score = new Score[userSkillClass.getSkillClass().getSkills().size()];
   for (int i = 0; i < userSkillClass.getSkillClass().getSkills().size(); i++) {
     Skill skill = userSkillClass.getSkillClass().getSkills().get(i);
     score[i] = boardClass.getScore(ChatColor.GREEN + skill.getScoreboardName() + ":");
     score[i].setScore(userSkillClass.getLevel(skill));
   }
   player.setScoreboard(board);
 }