SteamWar/SpigotCore
Archiviert
13
0

Merge branch 'master' into CMDStaticValue
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
YoyoNow 2021-12-08 17:02:06 +01:00
Commit 72c9b19ffb
5 geänderte Dateien mit 14 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -47,10 +47,10 @@ dependencies {
compileOnly files("${project.rootDir}/lib/WorldEdit-1.12.jar") compileOnly files("${project.rootDir}/lib/WorldEdit-1.12.jar")
implementation 'net.wesjd:anvilgui:1.4.0-SNAPSHOT' implementation 'net.wesjd:anvilgui:1.4.0-SNAPSHOT'
compileOnly 'org.projectlombok:lombok:1.18.6' compileOnly 'org.projectlombok:lombok:1.18.22'
testCompileOnly 'org.projectlombok:lombok:1.18.6' testCompileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.6' annotationProcessor 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.6' testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
} }
processResources { processResources {

Datei anzeigen

@ -78,6 +78,7 @@ public abstract class SWCommand {
} }
String string = args[args.length - 1].toLowerCase(); String string = args[args.length - 1].toLowerCase();
return commandList.stream() return commandList.stream()
.filter(s -> !s.noTabComplete)
.map(s -> s.tabComplete(sender, args)) .map(s -> s.tabComplete(sender, args))
.filter(Objects::nonNull) .filter(Objects::nonNull)
.flatMap(Collection::stream) .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"); Bukkit.getLogger().log(Level.WARNING, () -> "The method '" + method.toString() + "' is lacking the varArgs parameters of type '" + String.class.getTypeName() + "' as last Argument");
return; 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) { for (Method method : methods) {
@ -140,7 +141,7 @@ public abstract class SWCommand {
return; 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) -> { this.commandList.sort((o1, o2) -> {
@ -287,6 +288,8 @@ public abstract class SWCommand {
String[] description() default {}; String[] description() default {};
boolean noTabComplete() default false;
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD}) @Target({ElementType.METHOD})
@interface Registeres { @interface Registeres {

Datei anzeigen

@ -45,12 +45,14 @@ class SubCommand {
GuardChecker guardChecker; GuardChecker guardChecker;
Class<?> varArgType = null; Class<?> varArgType = null;
private boolean help; private boolean help;
boolean noTabComplete = false;
SubCommand(SWCommand swCommand, Method method, String[] subCommand, Map<String, TypeMapper<?>> localTypeMapper, Map<String, GuardChecker> localGuardChecker, boolean help, String[] description) { SubCommand(SWCommand swCommand, Method method, String[] subCommand, Map<String, TypeMapper<?>> localTypeMapper, Map<String, GuardChecker> localGuardChecker, boolean help, String[] description, boolean noTabComplete) {
this.swCommand = swCommand; this.swCommand = swCommand;
this.method = method; this.method = method;
this.help = help; this.help = help;
this.description = description; this.description = description;
this.noTabComplete = noTabComplete;
Parameter[] parameters = method.getParameters(); Parameter[] parameters = method.getParameters();
commandSenderPredicate = sender -> parameters[0].getType().isAssignableFrom(sender.getClass()); commandSenderPredicate = sender -> parameters[0].getType().isAssignableFrom(sender.getClass());

Datei anzeigen

@ -38,6 +38,7 @@ import java.util.logging.Level;
public class Core extends JavaPlugin{ public class Core extends JavaPlugin{
private static Core instance; private static Core instance;
private static final int version; private static final int version;
public static Message MESSAGE; public static Message MESSAGE;

Datei anzeigen

@ -1,5 +1,5 @@
#Wed May 05 10:45:33 CEST 2021 #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 distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists