mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 09:37:50 +01:00
Merge branch '2.x' into custom-currency-formatting
This commit is contained in:
commit
caeb59ede4
@ -260,5 +260,7 @@ public interface ISettings extends IConf {
|
||||
|
||||
boolean isCommandCooldownPersistent(String label);
|
||||
|
||||
boolean isNpcsInBalanceRanking();
|
||||
|
||||
NumberFormat getCurrencyFormat();
|
||||
}
|
||||
|
@ -547,6 +547,7 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
isCustomQuitMessage = !customQuitMessage.equals("none");
|
||||
muteCommands = _getMuteCommands();
|
||||
commandCooldowns = _getCommandCooldowns();
|
||||
npcsInBalanceRanking = _isNpcsInBalanceRanking();
|
||||
currencyFormat = _getCurrencyFormat();
|
||||
}
|
||||
|
||||
@ -1274,7 +1275,17 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
// TODO: enable per command cooldown specification for persistence.
|
||||
return config.getBoolean("command-cooldown-persistence", true);
|
||||
}
|
||||
|
||||
|
||||
private boolean npcsInBalanceRanking = false;
|
||||
|
||||
public boolean _isNpcsInBalanceRanking() {
|
||||
return config.getBoolean("npcs-in-balance-ranking", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNpcsInBalanceRanking() {
|
||||
return npcsInBalanceRanking;
|
||||
}
|
||||
private NumberFormat currencyFormat;
|
||||
|
||||
private NumberFormat _getCurrencyFormat() {
|
||||
|
@ -96,7 +96,11 @@ public class Commandbalancetop extends EssentialsCommand {
|
||||
} else {
|
||||
for (UUID u : ess.getUserMap().getAllUniqueUsers()) {
|
||||
final User user = ess.getUserMap().getUser(u);
|
||||
if (user != null && !user.isNPC()) { // Don't list NPCs in output
|
||||
if (user != null) {
|
||||
if (!ess.getSettings().isNpcsInBalanceRanking() && user.isNPC()) {
|
||||
// Don't list NPCs in output
|
||||
continue;
|
||||
}
|
||||
final BigDecimal userMoney = user.getMoney();
|
||||
user.updateMoneyCache(userMoney);
|
||||
totalMoney = totalMoney.add(userMoney);
|
||||
|
@ -502,6 +502,10 @@ command-cooldowns:
|
||||
# Whether command cooldowns should be persistent past server shutdowns
|
||||
command-cooldown-persistence: true
|
||||
|
||||
# Whether NPC balances should be listed in balance ranking features such as /balancetop.
|
||||
# NPC balances can include features like factions from FactionsUUID plugin.
|
||||
npcs-in-balance-ranking: false
|
||||
|
||||
############################################################
|
||||
# +------------------------------------------------------+ #
|
||||
# | EssentialsHome | #
|
||||
|
Loading…
Reference in New Issue
Block a user