diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCommandExecutor.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCommandExecutor.java index b573f7e6a..a77ba854a 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCommandExecutor.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCommandExecutor.java @@ -40,6 +40,7 @@ import org.bukkit.command.TabExecutor; import java.util.List; public class BukkitCommandExecutor extends CommandManager implements CommandExecutor, TabExecutor { + private static final Splitter TAB_COMPLETE_ARGUMENT_SPLITTER = Splitter.on(COMMAND_SEPARATOR_PATTERN); private static final Splitter ARGUMENT_SPLITTER = Splitter.on(COMMAND_SEPARATOR_PATTERN).omitEmptyStrings(); private static final Joiner ARGUMENT_JOINER = Joiner.on(' '); @@ -62,7 +63,7 @@ public class BukkitCommandExecutor extends CommandManager implements CommandExec @Override public List onTabComplete(CommandSender sender, Command command, String label, String[] args) { Sender lpSender = plugin.getSenderFactory().wrap(sender); - List arguments = Util.stripQuotes(ARGUMENT_SPLITTER.splitToList(ARGUMENT_JOINER.join(args))); + List arguments = Util.stripQuotes(TAB_COMPLETE_ARGUMENT_SPLITTER.splitToList(ARGUMENT_JOINER.join(args))); return onTabComplete(lpSender, arguments); } diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCommandExecutor.java b/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCommandExecutor.java index 549058233..08322efa8 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCommandExecutor.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCommandExecutor.java @@ -39,6 +39,7 @@ import net.md_5.bungee.api.plugin.TabExecutor; import java.util.List; public class BungeeCommandExecutor extends Command implements TabExecutor { + private static final Splitter TAB_COMPLETE_ARGUMENT_SPLITTER = Splitter.on(CommandManager.COMMAND_SEPARATOR_PATTERN); private static final Splitter ARGUMENT_SPLITTER = Splitter.on(CommandManager.COMMAND_SEPARATOR_PATTERN).omitEmptyStrings(); private static final Joiner ARGUMENT_JOINER = Joiner.on(' '); @@ -62,7 +63,7 @@ public class BungeeCommandExecutor extends Command implements TabExecutor { @Override public Iterable onTabComplete(CommandSender sender, String[] args) { Sender lpSender = plugin.getSenderFactory().wrap(sender); - List arguments = Util.stripQuotes(ARGUMENT_SPLITTER.splitToList(ARGUMENT_JOINER.join(args))); + List arguments = Util.stripQuotes(TAB_COMPLETE_ARGUMENT_SPLITTER.splitToList(ARGUMENT_JOINER.join(args))); return manager.onTabComplete(lpSender, arguments); } diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCommandExecutor.java b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCommandExecutor.java index 981705cec..830453a9e 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCommandExecutor.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCommandExecutor.java @@ -47,6 +47,7 @@ import java.util.Optional; import javax.annotation.Nullable; public class SpongeCommandExecutor extends CommandManager implements CommandCallable { + private static final Splitter TAB_COMPLETE_ARGUMENT_SPLITTER = Splitter.on(COMMAND_SEPARATOR_PATTERN); private static final Splitter ARGUMENT_SPLITTER = Splitter.on(COMMAND_SEPARATOR_PATTERN).omitEmptyStrings(); private final LPSpongePlugin plugin; @@ -68,7 +69,7 @@ public class SpongeCommandExecutor extends CommandManager implements CommandCall @Override public List getSuggestions(CommandSource source, String s, @Nullable Location location) { Sender lpSender = plugin.getSenderFactory().wrap(source); - List arguments = processSelectors(source, Util.stripQuotes(ARGUMENT_SPLITTER.splitToList(s))); + List arguments = processSelectors(source, Util.stripQuotes(TAB_COMPLETE_ARGUMENT_SPLITTER.splitToList(s))); return onTabComplete(lpSender, arguments); }