From b1f7f205ad1c8ad3c394e25ae3df2fb9306d17a5 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 15 Nov 2021 23:55:37 +0100 Subject: [PATCH] Add SubCommand --- SpigotCore_Main/src/de/steamwar/command/SubCommand.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java index e32dc38..9496d8c 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SubCommand.java +++ b/SpigotCore_Main/src/de/steamwar/command/SubCommand.java @@ -89,6 +89,9 @@ class SubCommand { private GuardChecker getGuardChecker(Parameter parameter, Map localGuardChecker) { SWCommand.Guard guard = parameter.getAnnotation(SWCommand.Guard.class); if (guard != null) { + if (guard.value() == null || guard.value().isEmpty()) { + return GUARD_FUNCTIONS.getOrDefault(parameter.getType().getTypeName(), null); + } GuardChecker current = localGuardChecker.getOrDefault(guard.value(), GUARD_FUNCTIONS.getOrDefault(guard.value(), null)); if (guardChecker == null) { Bukkit.getLogger().log(Level.WARNING, () -> "The guard checker with name '" + guard.value() + "' is neither a local guard checker nor a global one");