From 128aca96975b22a92743334d5c7392671bfa0a9d Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 10 May 2022 10:48:39 +0200 Subject: [PATCH] Fix stuff --- src/de/steamwar/command/AbstractSWCommand.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; }