if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.leaderboard"))
{
List<ClanPlayer> clanPlayers = plugin.getClanManager().getAllClanPlayers();
plugin.getClanManager().sortClanPlayersByKDR(clanPlayers);
ChatBlock chatBlock = new ChatBlock();
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("leaderboard.command") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("total.clan.players.0"), subColor + clanPlayers.size()));
ChatBlock.sendBlank(player);
chatBlock.setAlignment("c", "l", "c", "c", "c", "c");
chatBlock.addRow(" " + headColor + plugin.getLang("rank"), plugin.getLang("player"), plugin.getLang("kdr"), plugin.getLang("clan"), plugin.getLang("seen"));
int rank = 1;
for (ClanPlayer cp : clanPlayers)
{
Player p = cp.toPlayer();
boolean isOnline = false;
if (p != null)
{
isOnline = true;
}
String name = (cp.isLeader() ? plugin.getSettingsManager().getPageLeaderColor() : ((cp.isTrusted() ? plugin.getSettingsManager().getPageTrustedColor() : plugin.getSettingsManager().getPageUnTrustedColor()))) + cp.getName();
String lastSeen = (isOnline ? ChatColor.GREEN + plugin.getLang("online") : ChatColor.WHITE + cp.getLastSeenDaysString());
String clanTag = ChatColor.WHITE + plugin.getLang("free.agent");
if (cp.getClan() != null)
{
clanTag = cp.getClan().getColorTag();
}
chatBlock.addRow(" " + rank, name, ChatColor.YELLOW + "" + formatter.format(cp.getKDR()), ChatColor.WHITE + clanTag, lastSeen);
rank++;
}
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more)
{
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);