From d6cf8477f948db09ecc76c0e07fa091c616f8e41 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 3 Dec 2021 18:22:19 +0100 Subject: [PATCH 1/4] Add SWCommand.Register.noTabComplete --- SpigotCore_Main/src/de/steamwar/command/SWCommand.java | 7 +++++-- SpigotCore_Main/src/de/steamwar/command/SubCommand.java | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java index 258ab5c..60a2c6b 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java @@ -78,6 +78,7 @@ public abstract class SWCommand { } String string = args[args.length - 1].toLowerCase(); return commandList.stream() + .filter(s -> !s.noTabComplete) .map(s -> s.tabComplete(sender, args)) .filter(Objects::nonNull) .flatMap(Collection::stream) @@ -118,7 +119,7 @@ public abstract class SWCommand { Bukkit.getLogger().log(Level.WARNING, () -> "The method '" + method.toString() + "' is lacking the varArgs parameters of type '" + String.class.getTypeName() + "' as last Argument"); return; } - commandHelpList.add(new SubCommand(this, method, anno.value(), new HashMap<>(), localGuardChecker, true, null)); + commandHelpList.add(new SubCommand(this, method, anno.value(), new HashMap<>(), localGuardChecker, true, null, anno.noTabComplete())); }); } for (Method method : methods) { @@ -140,7 +141,7 @@ public abstract class SWCommand { return; } } - commandList.add(new SubCommand(this, method, anno.value(), localTypeMapper, localGuardChecker, false, anno.description())); + commandList.add(new SubCommand(this, method, anno.value(), localTypeMapper, localGuardChecker, false, anno.description(), anno.noTabComplete())); }); this.commandList.sort((o1, o2) -> { @@ -287,6 +288,8 @@ public abstract class SWCommand { String[] description() default {}; + boolean noTabComplete() default false; + @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) @interface Registeres { diff --git a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java index e18b5f8..bd6c743 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java @@ -45,12 +45,14 @@ class SubCommand { GuardChecker guardChecker; Class varArgType = null; private boolean help; + boolean noTabComplete = false; - SubCommand(SWCommand swCommand, Method method, String[] subCommand, Map> localTypeMapper, Map localGuardChecker, boolean help, String[] description) { + SubCommand(SWCommand swCommand, Method method, String[] subCommand, Map> localTypeMapper, Map localGuardChecker, boolean help, String[] description, boolean noTabComplete) { this.swCommand = swCommand; this.method = method; this.help = help; this.description = description; + this.noTabComplete = noTabComplete; Parameter[] parameters = method.getParameters(); commandSenderPredicate = sender -> parameters[0].getType().isAssignableFrom(sender.getClass()); From 70fca0bab32e8a50e4df1f51ff80a4bdab77020c Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 3 Dec 2021 20:16:21 +0100 Subject: [PATCH 2/4] Trigger rebuild --- SpigotCore_Main/src/de/steamwar/core/Core.java | 1 + 1 file changed, 1 insertion(+) diff --git a/SpigotCore_Main/src/de/steamwar/core/Core.java b/SpigotCore_Main/src/de/steamwar/core/Core.java index b0fc18f..82f0705 100644 --- a/SpigotCore_Main/src/de/steamwar/core/Core.java +++ b/SpigotCore_Main/src/de/steamwar/core/Core.java @@ -38,6 +38,7 @@ import java.util.logging.Level; public class Core extends JavaPlugin{ + private static Core instance; private static final int version; public static Message MESSAGE; From 378c12f7d74db45fefb2ecc23cf04bbedc6fe63e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 4 Dec 2021 10:48:36 +0100 Subject: [PATCH 3/4] Hotfix gradle-wrapper.properties --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 099d7b2..086800c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Wed May 05 10:45:33 CEST 2021 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists From 9b5629704c7f38c4b04906906ff35a38d5e940f4 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 4 Dec 2021 10:59:09 +0100 Subject: [PATCH 4/4] Hotfix build.gradle lombok version too old --- SpigotCore_Main/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SpigotCore_Main/build.gradle b/SpigotCore_Main/build.gradle index 7a48ea5..746d01e 100644 --- a/SpigotCore_Main/build.gradle +++ b/SpigotCore_Main/build.gradle @@ -47,10 +47,10 @@ dependencies { compileOnly files("${project.rootDir}/lib/WorldEdit-1.12.jar") implementation 'net.wesjd:anvilgui:1.4.0-SNAPSHOT' - compileOnly 'org.projectlombok:lombok:1.18.6' - testCompileOnly 'org.projectlombok:lombok:1.18.6' - annotationProcessor 'org.projectlombok:lombok:1.18.6' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.6' + compileOnly 'org.projectlombok:lombok:1.18.22' + testCompileOnly 'org.projectlombok:lombok:1.18.22' + annotationProcessor 'org.projectlombok:lombok:1.18.22' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.22' } processResources {