Catch commands containing spaces after slash

Fixes #307
This commit is contained in:
kaboom 2021-11-29 04:02:22 +02:00
parent b07f175fd8
commit f5af75f526

View file

@ -50,7 +50,10 @@ public final class ServerCommand implements Listener {
String commandName = arr[0].toLowerCase();
if (isConsoleCommand) {
commandName = "/" + arr[0].toLowerCase();
commandName = "/" + commandName;
} else if (arr.length >= 2 && commandName.equals("/")) {
// Command could contain spaces after the slash, e.g. "/ spawn"
commandName = "/" + arr[1].toLowerCase();
}
for (int i = 1; i < arr.length; i++) {