From e9833d1cd2baa2d97e064340ccd5b0657587a577 Mon Sep 17 00:00:00 2001 From: Glare Date: Thu, 30 May 2019 09:20:30 -0500 Subject: [PATCH] Implement essentials.balancetop.exclude permission (#2499) Closes #595. --- .../essentials/commands/Commandbalancetop.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java index b21d4408c..21271ca24 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java @@ -102,11 +102,13 @@ public class Commandbalancetop extends EssentialsCommand { // Don't list NPCs in output continue; } - final BigDecimal userMoney = user.getMoney(); - user.updateMoneyCache(userMoney); - totalMoney = totalMoney.add(userMoney); - final String name = user.isHidden() ? user.getName() : user.getDisplayName(); - balances.put(name, userMoney); + if (!user.isAuthorized("essentials.balancetop.exclude")) { + final BigDecimal userMoney = user.getMoney(); + user.updateMoneyCache(userMoney); + totalMoney = totalMoney.add(userMoney); + final String name = user.isHidden() ? user.getName() : user.getDisplayName(); + balances.put(name, userMoney); + } } } }