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,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);
}
}
}
}