diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java index 14bb850..35779c5 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommand.java @@ -79,9 +79,12 @@ public abstract class SWCommand { addMapper(ClassMapper.class, method, i -> i == 0, false, TypeMapper.class, (anno, typeMapper) -> { (anno.local() ? localTypeMapper : SWCommandUtils.MAPPER_FUNCTIONS).putIfAbsent(anno.value().getTypeName(), typeMapper); }); - add(Register.class, method, i -> i != 2, true, null, (anno, parameters) -> { + add(Register.class, method, i -> i > 0, true, null, (anno, parameters) -> { if (!anno.help()) return; List errors = new ArrayList<>(); + if (parameters.length != 2) { + errors.add("The method '" + method.toString() + "' is lacking parameters or has too many"); + } if (!parameters[parameters.length - 1].isVarArgs()) { errors.add("The method '" + method.toString() + "' is lacking the varArgs parameters as last Argument"); }