mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-14 05:01:28 +00:00
Add npcs-in-balance-ranking
configurable option. Resolves #716.
This commit is contained in:
parent
d75e0ce26e
commit
992ef5dc91
4 changed files with 23 additions and 1 deletions
|
@ -257,4 +257,6 @@ public interface ISettings extends IConf {
|
||||||
Entry<Pattern, Long> getCommandCooldownEntry(String label);
|
Entry<Pattern, Long> getCommandCooldownEntry(String label);
|
||||||
|
|
||||||
boolean isCommandCooldownPersistent(String label);
|
boolean isCommandCooldownPersistent(String label);
|
||||||
|
|
||||||
|
boolean isNpcsInBalanceRanking();
|
||||||
}
|
}
|
||||||
|
|
|
@ -536,6 +536,7 @@ public class Settings implements net.ess3.api.ISettings {
|
||||||
isCustomQuitMessage = !customQuitMessage.equals("none");
|
isCustomQuitMessage = !customQuitMessage.equals("none");
|
||||||
muteCommands = _getMuteCommands();
|
muteCommands = _getMuteCommands();
|
||||||
commandCooldowns = _getCommandCooldowns();
|
commandCooldowns = _getCommandCooldowns();
|
||||||
|
npcsInBalanceRanking = _isNpcsInBalanceRanking();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Integer> itemSpawnBl = new ArrayList<Integer>();
|
private List<Integer> itemSpawnBl = new ArrayList<Integer>();
|
||||||
|
@ -1262,4 +1263,15 @@ public class Settings implements net.ess3.api.ISettings {
|
||||||
// TODO: enable per command cooldown specification for persistence.
|
// TODO: enable per command cooldown specification for persistence.
|
||||||
return config.getBoolean("command-cooldown-persistence", true);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,11 @@ public class Commandbalancetop extends EssentialsCommand {
|
||||||
} else {
|
} else {
|
||||||
for (UUID u : ess.getUserMap().getAllUniqueUsers()) {
|
for (UUID u : ess.getUserMap().getAllUniqueUsers()) {
|
||||||
final User user = ess.getUserMap().getUser(u);
|
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();
|
final BigDecimal userMoney = user.getMoney();
|
||||||
user.updateMoneyCache(userMoney);
|
user.updateMoneyCache(userMoney);
|
||||||
totalMoney = totalMoney.add(userMoney);
|
totalMoney = totalMoney.add(userMoney);
|
||||||
|
|
|
@ -502,6 +502,10 @@ command-cooldowns:
|
||||||
# Whether command cooldowns should be persistent past server shutdowns
|
# Whether command cooldowns should be persistent past server shutdowns
|
||||||
command-cooldown-persistence: true
|
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 | #
|
# | EssentialsHome | #
|
||||||
|
|
Loading…
Reference in a new issue