mirror of
https://github.com/filoghost/ChestCommands.git
synced 2024-11-23 02:25:26 +01:00
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:
parent
5810443e4d
commit
862c98a128
@ -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);
|
||||||
|
@ -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());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user