diff --git a/Velocity/src/main/java/me/fixeddev/commandflow/velocity/VelocityCommandWrapper.java b/Velocity/src/main/java/me/fixeddev/commandflow/velocity/VelocityCommandWrapper.java index 7f71ae0e..3f1a8716 100644 --- a/Velocity/src/main/java/me/fixeddev/commandflow/velocity/VelocityCommandWrapper.java +++ b/Velocity/src/main/java/me/fixeddev/commandflow/velocity/VelocityCommandWrapper.java @@ -2,19 +2,16 @@ import com.velocitypowered.api.command.CommandSource; import com.velocitypowered.api.command.RawCommand; +import com.velocitypowered.api.command.SimpleCommand; import me.fixeddev.commandflow.CommandManager; import me.fixeddev.commandflow.Namespace; import me.fixeddev.commandflow.NamespaceImpl; import me.fixeddev.commandflow.command.Command; -import me.fixeddev.commandflow.exception.ArgumentParseException; import me.fixeddev.commandflow.exception.CommandException; -import me.fixeddev.commandflow.exception.CommandUsage; -import me.fixeddev.commandflow.exception.InvalidSubCommandException; -import me.fixeddev.commandflow.exception.NoMoreArgumentsException; -import me.fixeddev.commandflow.exception.NoPermissionsException; import me.fixeddev.commandflow.translator.Translator; import net.kyori.text.Component; +import java.util.Arrays; import java.util.List; public class VelocityCommandWrapper implements RawCommand { @@ -41,7 +38,7 @@ public VelocityCommandWrapper(Command command, CommandManager commandManager, @Override public void execute(Invocation invocation) { CommandSource commandSource = invocation.source(); - String argumentLine = invocation.alias() + invocation.arguments(); + String argumentLine = invocation.alias() + " " + invocation.arguments(); Namespace namespace = new NamespaceImpl(); namespace.setObject(CommandSource.class, VelocityCommandManager.SENDER_NAMESPACE, commandSource); @@ -73,12 +70,11 @@ public String[] getAliases() { @Override public List suggest(Invocation invocation) { CommandSource commandSource = invocation.source(); - String argumentLine = invocation.arguments(); Namespace namespace = new NamespaceImpl(); namespace.setObject(CommandSource.class, VelocityCommandManager.SENDER_NAMESPACE, commandSource); - return commandManager.getSuggestions(namespace, argumentLine); + return commandManager.getSuggestions(namespace, Arrays.asList(invocation.arguments())); } protected static void sendMessageToSender(CommandException exception, Namespace namespace) { diff --git a/pom.xml b/pom.xml index 1dc97ba6..cc932001 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ 0.5.2 0.5.0 0.5.2 - 0.5.2 + 0.5.3 0.5.2