Dieser Commit ist enthalten in:
Ursprung
211f6258b5
Commit
6e6d34905a
@ -144,16 +144,20 @@ public abstract class AbstractSWCommand<T> {
|
|||||||
for (Method method : methods) {
|
for (Method method : methods) {
|
||||||
add(Register.class, method, i -> i > 0, true, null, (anno, parameters) -> {
|
add(Register.class, method, i -> i > 0, true, null, (anno, parameters) -> {
|
||||||
if (!anno.help()) return;
|
if (!anno.help()) return;
|
||||||
|
boolean error = false;
|
||||||
if (parameters.length != 2) {
|
if (parameters.length != 2) {
|
||||||
commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking parameters or has too many");
|
commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking parameters or has too many");
|
||||||
|
error = true;
|
||||||
}
|
}
|
||||||
if (!parameters[parameters.length - 1].isVarArgs()) {
|
if (!parameters[parameters.length - 1].isVarArgs()) {
|
||||||
commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking the varArgs parameters as last Argument");
|
commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking the varArgs parameters as last Argument");
|
||||||
|
error = true;
|
||||||
}
|
}
|
||||||
if (parameters[parameters.length - 1].getType().getComponentType() != String.class) {
|
if (parameters[parameters.length - 1].getType().getComponentType() != String.class) {
|
||||||
commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking the varArgs parameters of type '" + String.class.getTypeName() + "' as last Argument");
|
commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking the varArgs parameters of type '" + String.class.getTypeName() + "' as last Argument");
|
||||||
return;
|
error = true;
|
||||||
}
|
}
|
||||||
|
if (error) return;
|
||||||
commandHelpList.add(new SubCommand<>(this, method, anno.value(), new HashMap<>(), new HashMap<>(), true, null, anno.noTabComplete()));
|
commandHelpList.add(new SubCommand<>(this, method, anno.value(), new HashMap<>(), new HashMap<>(), true, null, anno.noTabComplete()));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren