mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-16 23:55:28 +01:00
Merge branch 'default-confirm-command-prompt' of https://github.com/SupaHam/Essentials into SupaHam-default-confirm-command-prompt
This commit is contained in:
commit
ce1e584266
@ -302,4 +302,8 @@ public interface ISettings extends IConf {
|
||||
int getMotdDelay();
|
||||
|
||||
boolean isDirectHatAllowed();
|
||||
}
|
||||
|
||||
List<String> getDefaultDisabledConfirmCommands();
|
||||
|
||||
boolean isConfirmCommandEnabledByDefault(String commandName);
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -898,14 +898,14 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||
save();
|
||||
}
|
||||
|
||||
private boolean confirmPay = false; // players deny pay confirmation by default
|
||||
private Boolean confirmPay;
|
||||
|
||||
public boolean _getConfirmPay() {
|
||||
return config.getBoolean("confirm-pay", false);
|
||||
private Boolean _getConfirmPay() {
|
||||
return (Boolean) config.get("confirm-pay");
|
||||
}
|
||||
|
||||
public boolean isPromptingPayConfirm() {
|
||||
return confirmPay;
|
||||
return confirmPay != null ? confirmPay : ess.getSettings().isConfirmCommandEnabledByDefault("pay");
|
||||
}
|
||||
|
||||
public void setPromptingPayConfirm(boolean prompt) {
|
||||
@ -914,14 +914,14 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||
save();
|
||||
}
|
||||
|
||||
private boolean confirmClear = false; // players deny clear confirmation by default
|
||||
private Boolean confirmClear;
|
||||
|
||||
public boolean _getConfirmClear() {
|
||||
return config.getBoolean("confirm-clear", false);
|
||||
private Boolean _getConfirmClear() {
|
||||
return (Boolean) config.get("confirm-clear");
|
||||
}
|
||||
|
||||
public boolean isPromptingClearConfirm() {
|
||||
return confirmClear;
|
||||
return confirmClear != null ? confirmClear : ess.getSettings().isConfirmCommandEnabledByDefault("clearinventory");
|
||||
}
|
||||
|
||||
public void setPromptingClearConfirm(boolean prompt) {
|
||||
|
@ -516,6 +516,12 @@ allow-bulk-buy-sell: true
|
||||
# This has no effect if the MOTD command or permission are disabled.
|
||||
delay-motd: 0
|
||||
|
||||
# A list of commands that should have their complementary confirm commands disabled by default.
|
||||
# This is empty by default, for the latest list of valid commands see the latest source config.yml.
|
||||
default-disabled-confirm-commands:
|
||||
#- pay
|
||||
#- clearinventory
|
||||
|
||||
############################################################
|
||||
# +------------------------------------------------------+ #
|
||||
# | EssentialsHome | #
|
||||
|
Loading…
Reference in New Issue
Block a user