diff --git a/src/de/steamwar/command/AbstractSWCommand.java b/src/de/steamwar/command/AbstractSWCommand.java index e1d953e..7228084 100644 --- a/src/de/steamwar/command/AbstractSWCommand.java +++ b/src/de/steamwar/command/AbstractSWCommand.java @@ -127,7 +127,8 @@ public abstract class AbstractSWCommand { SWCommandUtils.getGUARD_FUNCTIONS().putIfAbsent(anno.value().getTypeName(), guardChecker); } }); - + } + for (Method method : methods) { add(Register.class, method, i -> i > 0, true, null, (anno, parameters) -> { if (!anno.help()) return; if (parameters.length != 2) { @@ -142,8 +143,7 @@ public abstract class AbstractSWCommand { } commandHelpList.add(new SubCommand(this, method, anno.value(), new HashMap<>(), localGuardChecker, true, null, anno.noTabComplete())); }); - } - for (Method method : methods) { + add(Register.class, method, i -> i > 0, true, null, (anno, parameters) -> { if (anno.help()) return; for (int i = 1; i < parameters.length; i++) { @@ -199,7 +199,7 @@ public abstract class AbstractSWCommand { commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking the first parameter of type '" + clazz.getTypeName() + "'"); return; } - if (returnType != null && !method.getReturnType().isAssignableFrom(returnType)) { + if (returnType != null && !returnType.isAssignableFrom(method.getReturnType())) { commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking the desired return type '" + returnType.getTypeName() + "'"); return; }