From 001239fe57e247de8f045d6af345fe56dc528efa Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Wed, 10 Jul 2024 16:08:42 +0200 Subject: [PATCH] Fix command identity --- .../paper/commands/PaperBrigadierCommand.java | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/commands/PaperBrigadierCommand.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/commands/PaperBrigadierCommand.java index 2d37ec5..497cf39 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/commands/PaperBrigadierCommand.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/commands/PaperBrigadierCommand.java @@ -77,9 +77,8 @@ public abstract class PaperBrigadierCommand extends BrigadierCommand { - updateVanillaPaperDispatcher(event.registrar().getDispatcher()); - }); + PandaLibPaper.getPlugin().getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, + event -> updateVanillaPaperDispatcher(event.registrar().getDispatcher())); Bukkit.getServer().getScheduler().runTask(PandaLibPaper.getPlugin(), () -> { @@ -222,17 +221,6 @@ public abstract class PaperBrigadierCommand extends BrigadierCommand command) { if (PluginCommandNode.REFLECT.get().isInstance(command)) { PluginCommandNode wrappedPCN = wrap(command, PluginCommandNode.class); @@ -240,7 +228,15 @@ public abstract class PaperBrigadierCommand extends BrigadierCommand