From 4a6d67bc2e14568108af0fe7bc7281b48199c25c Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Tue, 11 Aug 2026 16:55:57 -0700 Subject: [PATCH] fix(paper): unsafe registration under existing roots Unsafe registration under an existing root updated only Paper's API mirror node, leaving the server dispatcher unchanged. Add the updated root through the dispatcher root instead. --- .../incendo/cloud/paper/ModernPaperBrigadier.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/cloud-paper/src/main/java/org/incendo/cloud/paper/ModernPaperBrigadier.java b/cloud-paper/src/main/java/org/incendo/cloud/paper/ModernPaperBrigadier.java index bc270d90..847e545c 100644 --- a/cloud-paper/src/main/java/org/incendo/cloud/paper/ModernPaperBrigadier.java +++ b/cloud-paper/src/main/java/org/incendo/cloud/paper/ModernPaperBrigadier.java @@ -205,19 +205,11 @@ public boolean registerCommand(final @NonNull Command command) { } if (this.aliases.containsKey(command.rootComponent().name())) { - final CommandDispatcher dispatcher = - unsafeGet(commands, Commands::getDispatcher); + final RootCommandNode root = unsafeGet(commands, cmds -> cmds.getDispatcher().getRoot()); final Set registered = this.aliases.get(command.rootComponent().name()); - final LiteralCommandNode newRoot = this.createRootNode( - this.manager.commandTree().getNamedNode(command.rootComponent().name()), - command.rootComponent().name() - ); + final CommandNode rootNode = this.manager.commandTree().getNamedNode(command.rootComponent().name()); for (final String label : registered) { - final com.mojang.brigadier.tree.CommandNode node = - dispatcher.getRoot().getChild(label); - for (final com.mojang.brigadier.tree.CommandNode newChild : newRoot.getChildren()) { - node.addChild(newChild); - } + root.addChild(this.createRootNode(rootNode, label)); } } else { unsafeOperation(commands, cmds -> this.registerCommand(