mirror of
https://github.com/kaboomserver/extras.git
synced 2024-11-27 18:05:37 -05:00
Fix another error in command checker
This commit is contained in:
parent
9e967c9748
commit
2ee056fb2b
2 changed files with 12 additions and 8 deletions
|
@ -44,10 +44,12 @@ class PlayerCommand implements Listener {
|
||||||
final boolean isConsoleCommand = false;
|
final boolean isConsoleCommand = false;
|
||||||
final String checkedCommand = ServerCommand.checkCommand(sender, command, isConsoleCommand);
|
final String checkedCommand = ServerCommand.checkCommand(sender, command, isConsoleCommand);
|
||||||
|
|
||||||
if (checkedCommand.equals("cancel")) {
|
if (checkedCommand != null) {
|
||||||
event.setCancelled(true);
|
if (checkedCommand.equals("cancel")) {
|
||||||
} else if (checkedCommand != null) {
|
event.setCancelled(true);
|
||||||
event.setMessage(checkedCommand);
|
} else {
|
||||||
|
event.setMessage(checkedCommand);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,10 +178,12 @@ class ServerCommand implements Listener {
|
||||||
final boolean isConsoleCommand = true;
|
final boolean isConsoleCommand = true;
|
||||||
final String checkedCommand = checkCommand(sender, command, isConsoleCommand);
|
final String checkedCommand = checkCommand(sender, command, isConsoleCommand);
|
||||||
|
|
||||||
if (checkedCommand.equals("cancel")) {
|
if (checkedCommand != null) {
|
||||||
event.setCancelled(true);
|
if (checkedCommand.equals("cancel")) {
|
||||||
} else if (checkedCommand != null) {
|
event.setCancelled(true);
|
||||||
event.setCommand(checkedCommand);
|
} else {
|
||||||
|
event.setCommand(checkedCommand);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue