diff --git a/ChestCommands/src/com/gmail/filoghost/chestcommands/config/Settings.java b/ChestCommands/src/com/gmail/filoghost/chestcommands/config/Settings.java index ca5b383..4e50755 100644 --- a/ChestCommands/src/com/gmail/filoghost/chestcommands/config/Settings.java +++ b/ChestCommands/src/com/gmail/filoghost/chestcommands/config/Settings.java @@ -11,6 +11,7 @@ public class Settings extends SpecialConfig { public String multiple_commands_separator = ";"; public boolean update_notifications = true; public int anti_click_spam_delay = 200; + public boolean use_only_commands_without_args = true; public Settings(PluginConfig config) { super(config); diff --git a/ChestCommands/src/com/gmail/filoghost/chestcommands/listener/CommandListener.java b/ChestCommands/src/com/gmail/filoghost/chestcommands/listener/CommandListener.java index dbd7e5d..44523d3 100644 --- a/ChestCommands/src/com/gmail/filoghost/chestcommands/listener/CommandListener.java +++ b/ChestCommands/src/com/gmail/filoghost/chestcommands/listener/CommandListener.java @@ -13,6 +13,11 @@ public class CommandListener implements Listener { @EventHandler (priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onCommand(PlayerCommandPreprocessEvent event) { + + if (ChestCommands.getSettings().use_only_commands_without_args && event.getMessage().contains(" ")) { + return; + } + // Very fast method compared to split & substring. String command = StringUtils.getCleanCommand(event.getMessage());