From b08855f000cec3e2af8047ef84c1e4f7ba2f28df Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 30 Mar 2021 13:40:46 +0200 Subject: [PATCH] Fix SWCommandUtils.knownCommandMap --- SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java index 8cd20fe..b8c2c8c 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java @@ -24,6 +24,7 @@ import org.bukkit.GameMode; import org.bukkit.command.Command; import org.bukkit.command.CommandMap; import org.bukkit.command.CommandSender; +import org.bukkit.command.SimpleCommandMap; import org.bukkit.entity.Player; import java.lang.annotation.Annotation; @@ -89,7 +90,7 @@ public class SWCommandUtils { throw new SecurityException("Oh shit. Commands cannot be registered.", exception); } try { - final Field knownCommandsField = commandMap.getClass().getDeclaredField("knownCommands"); + final Field knownCommandsField = SimpleCommandMap.class.getDeclaredField("knownCommands"); knownCommandsField.setAccessible(true); knownCommandMap = (Map) knownCommandsField.get(commandMap); } catch (NoSuchFieldException | IllegalAccessException exception) {