From 598e8b406172bd7ac2f942b8525c74e573ce573c Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 21 Apr 2022 22:58:45 +0200 Subject: [PATCH] Fix return type for guard methods and typemapper methods --- src/de/steamwar/command/AbstractSWCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/command/AbstractSWCommand.java b/src/de/steamwar/command/AbstractSWCommand.java index b13c745..da80f23 100644 --- a/src/de/steamwar/command/AbstractSWCommand.java +++ b/src/de/steamwar/command/AbstractSWCommand.java @@ -180,7 +180,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() != returnType) { + if (returnType != null && !method.getReturnType().isAssignableFrom(returnType)) { commandSystemWarning(() -> "The method '" + method.toString() + "' is lacking the desired return type '" + returnType.getTypeName() + "'"); return; }