Do not apply starting balance for NPCs. Resolves #191

NPC balances are usually banks e.g. Factions plugin depending on EssentialsEco to provide economy functionality for the Faction.
This commit is contained in:
Ali Moghnieh 2016-06-27 21:45:31 +01:00
parent e95fad0453
commit d174cea42e
1 changed files with 5 additions and 0 deletions

View File

@ -93,6 +93,11 @@ public abstract class UserData extends PlayerExtension implements IConf {
BigDecimal result = ess.getSettings().getStartingBalance();
BigDecimal maxMoney = ess.getSettings().getMaxMoney();
BigDecimal minMoney = ess.getSettings().getMinMoney();
// NPC banks are not actual player banks, as such they do not have player starting balance.
if (isNPC()) {
result = BigDecimal.ZERO;
}
if (config.hasProperty("money")) {
result = config.getBigDecimal("money", result);