Add option to open menus only when there are commands without args. In

this way you can easily overwrite commands.
This commit is contained in:
filoghost 2015-01-09 21:00:28 +01:00
parent 5810443e4d
commit 862c98a128
2 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,7 @@ public class Settings extends SpecialConfig {
public String multiple_commands_separator = ";"; public String multiple_commands_separator = ";";
public boolean update_notifications = true; public boolean update_notifications = true;
public int anti_click_spam_delay = 200; public int anti_click_spam_delay = 200;
public boolean use_only_commands_without_args = true;
public Settings(PluginConfig config) { public Settings(PluginConfig config) {
super(config); super(config);

View File

@ -13,6 +13,11 @@ public class CommandListener implements Listener {
@EventHandler (priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler (priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onCommand(PlayerCommandPreprocessEvent event) { public void onCommand(PlayerCommandPreprocessEvent event) {
if (ChestCommands.getSettings().use_only_commands_without_args && event.getMessage().contains(" ")) {
return;
}
// Very fast method compared to split & substring. // Very fast method compared to split & substring.
String command = StringUtils.getCleanCommand(event.getMessage()); String command = StringUtils.getCleanCommand(event.getMessage());