From 3573c34bc6b231637946e25b1df42670e458fa24 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Sat, 25 Dec 2021 19:30:45 -0700 Subject: [PATCH] fix no args detected as 1 arg --- .../queue/platforms/bungeecord/commands/BungeeCommand.java | 3 +++ .../queue/platforms/velocity/commands/VelocityCommand.java | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/platforms/bungeecord/src/main/java/us/ajg0702/queue/platforms/bungeecord/commands/BungeeCommand.java b/platforms/bungeecord/src/main/java/us/ajg0702/queue/platforms/bungeecord/commands/BungeeCommand.java index e0d949b..10356e2 100644 --- a/platforms/bungeecord/src/main/java/us/ajg0702/queue/platforms/bungeecord/commands/BungeeCommand.java +++ b/platforms/bungeecord/src/main/java/us/ajg0702/queue/platforms/bungeecord/commands/BungeeCommand.java @@ -15,6 +15,9 @@ public class BungeeCommand extends Command implements TabExecutor { @Override public void execute(CommandSender sender, String[] args) { + if(args.length == 1 && args[0].isEmpty()) { + args = new String[]{}; + } command.execute(new BungeeSender(sender), args); } diff --git a/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/commands/VelocityCommand.java b/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/commands/VelocityCommand.java index c95021c..2354145 100644 --- a/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/commands/VelocityCommand.java +++ b/platforms/velocity/src/main/java/us/ajg0702/queue/platforms/velocity/commands/VelocityCommand.java @@ -20,7 +20,11 @@ public class VelocityCommand implements RawCommand { @Override public void execute(Invocation invocation) { - command.execute(new VelocitySender(invocation.source()), invocation.arguments().split(" ")); + String[] args = new String[]{}; + if(!invocation.arguments().isEmpty()) { + args = invocation.arguments().split(" "); + } + command.execute(new VelocitySender(invocation.source()), args); } @Override