diff options
Diffstat (limited to 'versions/src/main/java')
-rw-r--r-- | versions/src/main/java/cc/polyfrost/oneconfig/utils/commands/PlatformCommandManagerImpl.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/versions/src/main/java/cc/polyfrost/oneconfig/utils/commands/PlatformCommandManagerImpl.java b/versions/src/main/java/cc/polyfrost/oneconfig/utils/commands/PlatformCommandManagerImpl.java index da44d3b..6399055 100644 --- a/versions/src/main/java/cc/polyfrost/oneconfig/utils/commands/PlatformCommandManagerImpl.java +++ b/versions/src/main/java/cc/polyfrost/oneconfig/utils/commands/PlatformCommandManagerImpl.java @@ -67,11 +67,11 @@ public class PlatformCommandManagerImpl extends PlatformCommandManager { @Override public void - //#if MC<=10809 - processCommand(ICommandSender sender, String[] args) - //#else - //$$ execute(net.minecraft.server.MinecraftServer server, ICommandSender sender, String[] args) - //#endif + //#if MC<=10809 + processCommand(ICommandSender sender, String[] args) + //#else + //$$ execute(net.minecraft.server.MinecraftServer server, ICommandSender sender, String[] args) + //#endif { if (args.length == 0) { if (!root.invokers.isEmpty()) { @@ -141,11 +141,11 @@ public class PlatformCommandManagerImpl extends PlatformCommandManager { @Override public List<String> - //#if MC<=10809 - addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) - //#else - //$$ getTabCompletions(net.minecraft.server.MinecraftServer server, ICommandSender sender, String[] args, BlockPos targetPos) - //#endif + //#if MC<=10809 + addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + //#else + //$$ getTabCompletions(net.minecraft.server.MinecraftServer server, ICommandSender sender, String[] args, BlockPos targetPos) + //#endif { try { Set<Pair<InternalCommand.InternalCommandInvoker, Integer>> commands = new HashSet<>(); @@ -283,7 +283,8 @@ public class PlatformCommandManagerImpl extends PlatformCommandManager { } boolean added = false; for (CommandManager.InternalCommand.InternalCommandInvoker invoker : command.invokers) { - if (args.length - nextDepth == invoker.parameterTypes.length) { + if (args.length - nextDepth == invoker.parameterTypes.length || + invoker.method.getParameters()[invoker.parameterTypes.length - 1].isAnnotationPresent(Greedy.class)) { commands.add(invoker); added = true; } else { |