From 091ce4c72c123f43f317c097818ace15f3a085fa Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Wed, 10 Aug 2022 10:15:01 +0200 Subject: Profile command (#88) * e * omg finish profile shit * api and fix 1.12.2 preprocess * fix class names --- .../utils/commands/PlatformCommandManagerImpl.java | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'versions/src/main/java/cc/polyfrost/oneconfig/utils') 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 - //#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> 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 { -- cgit