public void loadPlayer(Player player) { StatistikPlayer statistikPlayer = new StatistikPlayer(playerTable, player.getName()); players.add(statistikPlayer); statistikPlayer.setAviableRanks(plugin.getRankManager().getRanks(player)); }
public void checkNewRanks() { if (players.size() > 0) { for (StatistikPlayer player : players) { Player spieler = plugin.getServer().getPlayer(player.getName()); ArrayList<Rank> ranks = Statistik.getInstance() .getRankManager() .getRanks(plugin.getServer().getPlayer(player.getName())); ArrayList<Rank> newRanks = Statistik.getInstance() .getRankManager() .getRanks(plugin.getServer().getPlayer(player.getName())); ArrayList<Rank> oldRanks = player.getAviableRanks(); if (oldRanks != null) { if (ranks != null) { if (ranks.size() > 0) { for (Rank rank : ranks) { for (Rank rank2 : oldRanks) { if (rank.equals(rank2)) { newRanks.remove(rank); } } } } if (ranks.size() > 0) { for (Rank rank : newRanks) { spieler.sendMessage( ChatColor.GOLD + "Du hast soeben den Titel " + rank.getName() + ChatColor.WHITE + " freigeschaltet, nutze nun " + ChatColor.GREEN + "/rank set " + rank.getTag() + ChatColor.GOLD + " um den Titel festzulegen."); } } } } else { if (ranks != null) { for (Rank rank : ranks) { spieler.sendMessage( ChatColor.GOLD + "Du hast soeben den Titel " + rank.getName() + ChatColor.WHITE + " freigeschaltet, nutze nun " + ChatColor.GREEN + "/rank set " + rank.getTag() + ChatColor.GOLD + " um den Titel festzulegen."); } } } player.setAviableRanks(ranks); } } }