Add the option to disable disabled-sign name protection. (#699)

This allows EssentialsX users to use other plugins that provide signs such as [Kit] and not have EssentialsX interfere with the final sign name.
This commit is contained in:
Ali Moghnieh 2016-07-01 16:23:54 +01:00 committed by Ali Moghnieh
parent 19f6510840
commit c9f1b0fdc5
No known key found for this signature in database
GPG key ID: F09D3A1BAF2E6D70
4 changed files with 45 additions and 1 deletions

View file

@ -549,6 +549,7 @@ public class Settings implements net.ess3.api.ISettings {
commandCooldowns = _getCommandCooldowns();
npcsInBalanceRanking = _isNpcsInBalanceRanking();
currencyFormat = _getCurrencyFormat();
unprotectedSigns = _getUnprotectedSign();
}
private List<Integer> itemSpawnBl = new ArrayList<Integer>();
@ -1328,4 +1329,29 @@ public class Settings implements net.ess3.api.ISettings {
public NumberFormat getCurrencyFormat() {
return this.currencyFormat;
}
private List<EssentialsSign> unprotectedSigns = Collections.emptyList();
@Override
public List<EssentialsSign> getUnprotectedSignNames() {
return this.unprotectedSigns;
}
private List<EssentialsSign> _getUnprotectedSign() {
List<EssentialsSign> newSigns = new ArrayList<>();
for (String signName : config.getStringList("unprotected-sign-names")) {
signName = signName.trim().toUpperCase(Locale.ENGLISH);
if (signName.isEmpty()) {
continue;
}
try {
newSigns.add(Signs.valueOf(signName).getSign());
} catch (Exception ex) {
logger.log(Level.SEVERE, tl("unknownItemInList", signName, "unprotected-sign-names"));
continue;
}
}
return newSigns;
}
}