diff --git a/src/main/java/pw/kaboom/extras/modules/player/PlayerCommand.java b/src/main/java/pw/kaboom/extras/modules/player/PlayerCommand.java index 92d790f..e351663 100644 --- a/src/main/java/pw/kaboom/extras/modules/player/PlayerCommand.java +++ b/src/main/java/pw/kaboom/extras/modules/player/PlayerCommand.java @@ -44,10 +44,12 @@ class PlayerCommand implements Listener { final boolean isConsoleCommand = false; final String checkedCommand = ServerCommand.checkCommand(sender, command, isConsoleCommand); - if (checkedCommand.equals("cancel")) { - event.setCancelled(true); - } else if (checkedCommand != null) { - event.setMessage(checkedCommand); + if (checkedCommand != null) { + if (checkedCommand.equals("cancel")) { + event.setCancelled(true); + } else { + event.setMessage(checkedCommand); + } } } } diff --git a/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java b/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java index ebffdba..40b7ea3 100644 --- a/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java +++ b/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java @@ -178,10 +178,12 @@ class ServerCommand implements Listener { final boolean isConsoleCommand = true; final String checkedCommand = checkCommand(sender, command, isConsoleCommand); - if (checkedCommand.equals("cancel")) { - event.setCancelled(true); - } else if (checkedCommand != null) { - event.setCommand(checkedCommand); + if (checkedCommand != null) { + if (checkedCommand.equals("cancel")) { + event.setCancelled(true); + } else { + event.setCommand(checkedCommand); + } } } }