diff --git a/patches/server/Brigadier-based-command-API.patch b/patches/server/Brigadier-based-command-API.patch index 6064cef2c0..23d7d5cf0d 100644 --- a/patches/server/Brigadier-based-command-API.patch +++ b/patches/server/Brigadier-based-command-API.patch @@ -2146,14 +2146,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 for (int i = 0; i < Math.min(astacktraceelement.length, 3); ++i) { @@ -0,0 +0,0 @@ public class Commands { + private void sendAsync(ServerPlayer player) { + // Paper end - Perf: Async command map building Map, CommandNode> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues - RootCommandNode vanillaRoot = new RootCommandNode(); - +- RootCommandNode vanillaRoot = new RootCommandNode(); +- - RootCommandNode vanilla = player.server.vanillaCommandDispatcher.getDispatcher().getRoot(); -+ RootCommandNode vanilla = player.server.getCommands().getDispatcher().getRoot(); // Paper - map.put(vanilla, vanillaRoot); - this.fillUsableCommands(vanilla, vanillaRoot, player.createCommandSourceStack(), (Map) map); +- map.put(vanilla, vanillaRoot); +- this.fillUsableCommands(vanilla, vanillaRoot, player.createCommandSourceStack(), (Map) map); +- +- // Now build the global commands in a second pass ++ // Paper - brigadier API removes the need to fill the map twice + RootCommandNode rootcommandnode = new RootCommandNode(); + map.put(this.dispatcher.getRoot(), rootcommandnode); @@ -0,0 +0,0 @@ public class Commands { }