diff --git a/src/de/steamwar/command/AbstractSWCommand.java b/src/de/steamwar/command/AbstractSWCommand.java index e30ac7b..c23fd91 100644 --- a/src/de/steamwar/command/AbstractSWCommand.java +++ b/src/de/steamwar/command/AbstractSWCommand.java @@ -144,16 +144,20 @@ public abstract class AbstractSWCommand { for (Method method : methods) { add(Register.class, method, i -> i > 0, true, null, (anno, parameters) -> { if (!anno.help()) return; + boolean error = false; if (parameters.length != 2) { commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking parameters or has too many"); + error = true; } if (!parameters[parameters.length - 1].isVarArgs()) { commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking the varArgs parameters as last Argument"); + error = true; } 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"); - return; + error = true; } + if (error) return; commandHelpList.add(new SubCommand<>(this, method, anno.value(), new HashMap<>(), new HashMap<>(), true, null, anno.noTabComplete())); });