Skip to content

Commit 9ed6801

Browse files
committed
Added the %essentials_baltop_rank% placeholder
1 parent 5d36248 commit 9ed6801

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/main/java/com/extendedclip/papi/expansion/essentials/EssentialsExpansion.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,21 @@ public String onRequest(OfflinePlayer player, @NotNull String identifier) {
269269
return entries[id].getDisplayName();
270270
}
271271

272+
if (identifier.equals("rank")) {
273+
if (!baltopCache.containsKey(player.getUniqueId())) {
274+
return "";
275+
}
276+
277+
int index = 1;
278+
for (Map.Entry<UUID, BalanceTop.Entry> entry : baltopCache.entrySet()) {
279+
if (entry.getKey() == player.getUniqueId()) {
280+
return String.valueOf(index);
281+
}
282+
283+
index++;
284+
}
285+
}
286+
272287
return null;
273288
}
274289

0 commit comments

Comments
 (0)