Implement essentials.balancetop.exclude permission (#2499)

Closes #595.
This commit is contained in:
Glare 2019-05-30 09:20:30 -05:00 committed by md678685
parent 0e3f48ee54
commit e9833d1cd2

View File

@ -102,6 +102,7 @@ public class Commandbalancetop extends EssentialsCommand {
// Don't list NPCs in output
continue;
}
if (!user.isAuthorized("essentials.balancetop.exclude")) {
final BigDecimal userMoney = user.getMoney();
user.updateMoneyCache(userMoney);
totalMoney = totalMoney.add(userMoney);
@ -110,6 +111,7 @@ public class Commandbalancetop extends EssentialsCommand {
}
}
}
}
final List<Map.Entry<String, BigDecimal>> sortedEntries = new ArrayList<Map.Entry<String, BigDecimal>>(balances.entrySet());
Collections.sort(sortedEntries, new Comparator<Map.Entry<String, BigDecimal>>() {