mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-04 19:46:27 +00:00
Add default toggle for confirm commands in config.yml.
This commit is contained in:
parent
752565b8f1
commit
1ef1cd98db
4 changed files with 41 additions and 10 deletions
|
@ -532,6 +532,7 @@ public class Settings implements net.ess3.api.ISettings {
|
|||
npcsInBalanceRanking = _isNpcsInBalanceRanking();
|
||||
currencyFormat = _getCurrencyFormat();
|
||||
unprotectedSigns = _getUnprotectedSign();
|
||||
defaultDisabledConfirmCommands = _getDefaultDisabledConfirmCommands();
|
||||
}
|
||||
|
||||
private List<Integer> itemSpawnBl = new ArrayList<Integer>();
|
||||
|
@ -1418,4 +1419,24 @@ public class Settings implements net.ess3.api.ISettings {
|
|||
public boolean isDirectHatAllowed() {
|
||||
return config.getBoolean("allow-direct-hat", true);
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> defaultDisabledConfirmCommands;
|
||||
|
||||
private List<String> _getDefaultDisabledConfirmCommands() {
|
||||
List<String> commands = config.getStringList("default-disabled-confirm-commands");
|
||||
for (int i = 0; i < commands.size(); i++) {
|
||||
commands.set(i, commands.get(i).toLowerCase());
|
||||
}
|
||||
return commands;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDefaultDisabledConfirmCommands() {
|
||||
return defaultDisabledConfirmCommands;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConfirmCommandEnabledByDefault(String commandName) {
|
||||
return !getDefaultDisabledConfirmCommands().contains(commandName.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue