Brigadier: fix simpleUnwrap not keeping redirect modifier and forks properties from original node (#11654)

This commit is contained in:
Marc Baloup 2024-12-08 22:23:55 +01:00
parent a53051b155
commit ba939d1391

View file

@ -10,6 +10,7 @@ public net.minecraft.server.ReloadableServerResources registryLookup
public net.minecraft.server.ReloadableServerResources
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Marc Baloup <marc.baloup@laposte.net>
diff --git a/src/main/java/com/mojang/brigadier/CommandDispatcher.java b/src/main/java/com/mojang/brigadier/CommandDispatcher.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@ -505,7 +506,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ private CommandNode<CommandSourceStack> simpleUnwrap(final CommandNode<CommandSourceStack> node) {
+ return node.createBuilder()
+ .redirect(node.getRedirect() == null ? null : this.unwrapNode(node.getRedirect()))
+ .forward(node.getRedirect() == null ? null : this.unwrapNode(node.getRedirect()), node.getRedirectModifier(), node.isFork())
+ .build();
+ }
+