mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-23 22:14:09 +00:00
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:
parent
19f6510840
commit
c9f1b0fdc5
4 changed files with 45 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue