Default setting to be enabled confirm commands by default with commented out list of possible options

This commit is contained in:
Trent Hensler 2018-03-26 00:24:10 -07:00
parent ce1e584266
commit a468ec5e08
3 changed files with 10 additions and 10 deletions

View file

@ -303,7 +303,7 @@ public interface ISettings extends IConf {
boolean isDirectHatAllowed(); boolean isDirectHatAllowed();
List<String> getDefaultDisabledConfirmCommands(); List<String> getDefaultEnabledConfirmCommands();
boolean isConfirmCommandEnabledByDefault(String commandName); boolean isConfirmCommandEnabledByDefault(String commandName);
} }

View file

@ -532,7 +532,7 @@ public class Settings implements net.ess3.api.ISettings {
npcsInBalanceRanking = _isNpcsInBalanceRanking(); npcsInBalanceRanking = _isNpcsInBalanceRanking();
currencyFormat = _getCurrencyFormat(); currencyFormat = _getCurrencyFormat();
unprotectedSigns = _getUnprotectedSign(); unprotectedSigns = _getUnprotectedSign();
defaultDisabledConfirmCommands = _getDefaultDisabledConfirmCommands(); defaultEnabledConfirmCommands = _getDefaultEnabledConfirmCommands();
} }
private List<Integer> itemSpawnBl = new ArrayList<Integer>(); private List<Integer> itemSpawnBl = new ArrayList<Integer>();
@ -1420,10 +1420,10 @@ public class Settings implements net.ess3.api.ISettings {
return config.getBoolean("allow-direct-hat", true); return config.getBoolean("allow-direct-hat", true);
} }
private List<String> defaultDisabledConfirmCommands; private List<String> defaultEnabledConfirmCommands;
private List<String> _getDefaultDisabledConfirmCommands() { private List<String> _getDefaultEnabledConfirmCommands() {
List<String> commands = config.getStringList("default-disabled-confirm-commands"); List<String> commands = config.getStringList("default-enabled-confirm-commands");
for (int i = 0; i < commands.size(); i++) { for (int i = 0; i < commands.size(); i++) {
commands.set(i, commands.get(i).toLowerCase()); commands.set(i, commands.get(i).toLowerCase());
} }
@ -1431,12 +1431,12 @@ public class Settings implements net.ess3.api.ISettings {
} }
@Override @Override
public List<String> getDefaultDisabledConfirmCommands() { public List<String> getDefaultEnabledConfirmCommands() {
return defaultDisabledConfirmCommands; return defaultEnabledConfirmCommands;
} }
@Override @Override
public boolean isConfirmCommandEnabledByDefault(String commandName) { public boolean isConfirmCommandEnabledByDefault(String commandName) {
return !getDefaultDisabledConfirmCommands().contains(commandName.toLowerCase()); return getDefaultEnabledConfirmCommands().contains(commandName.toLowerCase());
} }
} }

View file

@ -516,9 +516,9 @@ allow-bulk-buy-sell: true
# This has no effect if the MOTD command or permission are disabled. # This has no effect if the MOTD command or permission are disabled.
delay-motd: 0 delay-motd: 0
# A list of commands that should have their complementary confirm commands disabled by default. # A list of commands that should have their complementary confirm commands enabled by default.
# This is empty by default, for the latest list of valid commands see the latest source config.yml. # This is empty by default, for the latest list of valid commands see the latest source config.yml.
default-disabled-confirm-commands: default-enabled-confirm-commands:
#- pay #- pay
#- clearinventory #- clearinventory