aboutsummaryrefslogtreecommitdiff
path: root/versions/src/main/java/cc/polyfrost/oneconfig/utils
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-08-10 10:15:01 +0200
committerGitHub <noreply@github.com>2022-08-10 17:15:01 +0900
commit091ce4c72c123f43f317c097818ace15f3a085fa (patch)
tree9a151e29494ef2683b2bff59fec19b56d4a05fb0 /versions/src/main/java/cc/polyfrost/oneconfig/utils
parent799c389fdb993e363d71d268e0df9ae9f0a0c8a1 (diff)
downloadOneConfig-091ce4c72c123f43f317c097818ace15f3a085fa.tar.gz
OneConfig-091ce4c72c123f43f317c097818ace15f3a085fa.tar.bz2
OneConfig-091ce4c72c123f43f317c097818ace15f3a085fa.zip
Profile command (#88)
* e * omg finish profile shit * api and fix 1.12.2 preprocess * fix class names
Diffstat (limited to 'versions/src/main/java/cc/polyfrost/oneconfig/utils')
-rw-r--r--versions/src/main/java/cc/polyfrost/oneconfig/utils/commands/PlatformCommandManagerImpl.java23
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 {