From f5af75f52644932d7fcffb10a67c6cbaf77e1620 Mon Sep 17 00:00:00 2001 From: kaboom <58372747+kaboombot@users.noreply.github.com> Date: Mon, 29 Nov 2021 04:02:22 +0200 Subject: [PATCH] Catch commands containing spaces after slash Fixes #307 --- .../java/pw/kaboom/extras/modules/server/ServerCommand.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ce1195c..2d364c7 100644 --- a/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java +++ b/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java @@ -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++) {