From 006754990c7c05b2f33d37df24d2900f63d1474d Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 9 Dec 2021 23:23:41 +0100 Subject: [PATCH] Fix SWCommandUtils.generateCommandPart --- SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java index c9b7f43..b212b00 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java @@ -191,7 +191,7 @@ public class SWCommandUtils { SWCommand.Guard guard = parameter.getAnnotation(SWCommand.Guard.class); if (guard != null) { - if (guard.value() != null) { + if (guard.value() != null && !guard.value().isEmpty()) { return getGuardChecker(guard.value(), localGuardChecker); } return getGuardChecker(clazz.getTypeName(), localGuardChecker); @@ -200,6 +200,9 @@ public class SWCommandUtils { } private static GuardChecker getGuardChecker(String s, Map localGuardChecker) { + System.out.println(": " + s); + System.out.println(localGuardChecker); + System.out.println(GUARD_FUNCTIONS); GuardChecker guardChecker = localGuardChecker.getOrDefault(s, GUARD_FUNCTIONS.getOrDefault(s, null)); if (guardChecker == null) { throw new IllegalArgumentException("No guard found for " + s);