diff --git a/gradle.properties b/gradle.properties index 42ba350..a7028a1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=5.1.0 +version=5.1.1 diff --git a/velocity/src/main/java/fr/traqueur/commands/velocity/VelocityExecutor.java b/velocity/src/main/java/fr/traqueur/commands/velocity/VelocityExecutor.java index 94a4545..b66a99f 100644 --- a/velocity/src/main/java/fr/traqueur/commands/velocity/VelocityExecutor.java +++ b/velocity/src/main/java/fr/traqueur/commands/velocity/VelocityExecutor.java @@ -37,7 +37,8 @@ public VelocityExecutor(CommandManager manager) { @Override public void execute(Invocation invocation) { CommandSource source = invocation.source(); - String[] args = invocation.arguments().split(" "); + String rawInput = invocation.arguments(); + String[] args = rawInput.isEmpty() ? new String[0] : rawInput.split(" "); String label = invocation.alias(); String labelLower = label.toLowerCase(); this.manager.getInvoker().invoke(source, labelLower, args); @@ -53,7 +54,8 @@ public void execute(Invocation invocation) { @Override public List suggest(Invocation invocation) { CommandSource source = invocation.source(); - String[] args = invocation.arguments().split(" "); + String rawInput = invocation.arguments(); + String[] args = rawInput.isEmpty() ? new String[0] : rawInput.split(" ", -1); String label = invocation.alias(); String labelLower = label.toLowerCase(); return this.manager.getInvoker().suggest(source, labelLower, args);