public void clean() { if (!isEmpty()) { for (UUID id : this.players.keySet()) { Utils.getPlayer(id).setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard()); } } }
public boolean removeMember(UUID member) { if (!this.players.containsKey(member)) { return false; } this.players.remove(member); Utils.getPlayer(member).setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard()); updateScoreboard(); return true; }
public void syncItemStack() { ItemMeta meta = getItemMeta(); meta.setDisplayName(ChatColor.DARK_GRAY + getName()); if (Utils.isBukkitClass("org.bukkit.inventory.ItemFlag")) meta.addItemFlags(ItemFlag.values()); List<String> lore = new ArrayList<String>(); lore.add(ChatColor.BLUE + " + " + this.player.getDexterity()); lore.add(" "); lore.add(ChatColor.GOLD + "Drag a skillstar at the book"); lore.add(ChatColor.GOLD + "to increase your dexterity"); lore.add(" "); lore.add(ChatColor.RED + "soulbound!"); meta.setLore(lore); setItemMeta(meta); }
public void updateScoreboard() { ScoreBoard board = new ScoreBoard(); board.add(ChatColor.YELLOW + "" + this.experience + " Exp!"); board.add(" "); board.add(ChatColor.BLUE + "Members:"); for (UUID id : this.players.keySet()) { if (Utils.getPlayer(id) != null) { String str = ChatColor.GOLD + Utils.getPlayer(id).getName() + " " + ChatColor.YELLOW + Math.round(((Float) this.players.get(id)).floatValue() / this.experience * 100.0F) + "%"; if ((str.length() > 16) && (Utils.getPlayer(id).getName().length() >= 10)) { str = ChatColor.GOLD + Utils.getPlayer(id).getName().substring(0, 9) + ". " + ChatColor.YELLOW + Math.round( ((Float) this.players.get(id)).floatValue() / this.experience * 100.0F) + "%"; } board.add(str); } } for (UUID id : this.players.keySet()) { board.setScoreboard( "gruppe", ChatColor.GOLD + Utils.getPlayer(this.creator).getName() + "s " + ChatColor.BLUE + "group", Utils.getPlayer(id)); } }