Dieser Commit ist enthalten in:
Ursprung
128aca9697
Commit
0f03b57e43
@ -141,7 +141,7 @@ public abstract class AbstractSWCommand<T> {
|
||||
commandSystemWarning(() -> "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, anno.noTabComplete()));
|
||||
commandHelpList.add(new SubCommand<>(this, method, anno.value(), new HashMap<>(), localGuardChecker, true, null, anno.noTabComplete()));
|
||||
});
|
||||
|
||||
add(Register.class, method, i -> i > 0, true, null, (anno, parameters) -> {
|
||||
@ -162,27 +162,27 @@ public abstract class AbstractSWCommand<T> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
commandList.add(new SubCommand(this, method, anno.value(), localTypeMapper, localGuardChecker, false, anno.description(), anno.noTabComplete()));
|
||||
});
|
||||
|
||||
this.commandList.sort((o1, o2) -> {
|
||||
int compare = Integer.compare(-o1.subCommand.length, -o2.subCommand.length);
|
||||
if (compare != 0) {
|
||||
return compare;
|
||||
} else {
|
||||
return Integer.compare(o1.comparableValue, o2.comparableValue);
|
||||
}
|
||||
});
|
||||
commandHelpList.sort((o1, o2) -> {
|
||||
int compare = Integer.compare(-o1.subCommand.length, -o2.subCommand.length);
|
||||
if (compare != 0) {
|
||||
return compare;
|
||||
} else {
|
||||
return Integer.compare(o1.method.getDeclaringClass() == AbstractSWCommand.class ? 1 : 0,
|
||||
o2.method.getDeclaringClass() == AbstractSWCommand.class ? 1 : 0);
|
||||
}
|
||||
commandList.add(new SubCommand<>(this, method, anno.value(), localTypeMapper, localGuardChecker, false, anno.description(), anno.noTabComplete()));
|
||||
});
|
||||
}
|
||||
|
||||
this.commandList.sort((o1, o2) -> {
|
||||
int compare = Integer.compare(-o1.subCommand.length, -o2.subCommand.length);
|
||||
if (compare != 0) {
|
||||
return compare;
|
||||
} else {
|
||||
return Integer.compare(o1.comparableValue, o2.comparableValue);
|
||||
}
|
||||
});
|
||||
commandHelpList.sort((o1, o2) -> {
|
||||
int compare = Integer.compare(-o1.subCommand.length, -o2.subCommand.length);
|
||||
if (compare != 0) {
|
||||
return compare;
|
||||
} else {
|
||||
return Integer.compare(o1.method.getDeclaringClass() == AbstractSWCommand.class ? 1 : 0,
|
||||
o2.method.getDeclaringClass() == AbstractSWCommand.class ? 1 : 0);
|
||||
}
|
||||
});
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ public abstract class AbstractSWCommand<T> {
|
||||
private List<Method> methods() {
|
||||
List<Method> methods = new ArrayList<>();
|
||||
Class<?> current = getClass();
|
||||
while (current.getSuperclass() != AbstractSWCommand.class) {
|
||||
while (current != AbstractSWCommand.class) {
|
||||
methods.addAll(Arrays.asList(current.getDeclaredMethods()));
|
||||
current = current.getSuperclass();
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren