Added the %essentials_baltop_rank% placeholder

This commit is contained in:
BlitzOffline committed 2022-03-18 20:16:41 +02:00
1 parent 5d36248b70
commit 9ed6801cb5
1 file changed
+15
@@ -269,6 +269,21 @@ public class EssentialsExpansion extends PlaceholderExpansion {
return entries[id].getDisplayName();
}
if (identifier.equals("rank")) {
if (!baltopCache.containsKey(player.getUniqueId())) {
return "";
}
int index = 1;
for (Map.Entry<UUID, BalanceTop.Entry> entry : baltopCache.entrySet()) {
if (entry.getKey() == player.getUniqueId()) {
return String.valueOf(index);
}
index++;
}
}
return null;
}