From 6949e999ebc63778124f5a3b8772b9a0b13bba7b Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 26 Apr 2021 01:27:08 +0100 Subject: [PATCH] Send empty commands if tab completion is disabled --- .../net/minecraft/commands/Commands.java.patch | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/commands/Commands.java.patch b/paper-server/patches/sources/net/minecraft/commands/Commands.java.patch index 1488986921..cca3d6f91f 100644 --- a/paper-server/patches/sources/net/minecraft/commands/Commands.java.patch +++ b/paper-server/patches/sources/net/minecraft/commands/Commands.java.patch @@ -190,12 +190,17 @@ } } else { callback.accept(executioncontext); -@@ -377,22 +453,84 @@ +@@ -377,22 +453,89 @@ } public void sendCommands(ServerPlayer player) { - Map, CommandNode> map = Maps.newHashMap(); -+ if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot ++ // Paper start - Send empty commands if tab completion is disabled ++ if (org.spigotmc.SpigotConfig.tabComplete < 0) { ++ player.connection.send(new ClientboundCommandsPacket(new RootCommandNode<>())); ++ return; ++ } ++ // Paper end - Send empty commands if tab completion is disabled + // CraftBukkit start + // Register Vanilla commands into builtRoot as before + // Paper start - Perf: Async command map building @@ -280,7 +285,7 @@ argumentbuilder.requires((icompletionprovider) -> { return true; -@@ -415,12 +553,12 @@ +@@ -415,12 +558,12 @@ argumentbuilder.redirect((CommandNode) resultNodes.get(argumentbuilder.getRedirect())); } @@ -295,7 +300,7 @@ } } } -@@ -481,7 +619,7 @@ +@@ -481,7 +624,7 @@ } private HolderLookup.RegistryLookup.Delegate createLookup(final HolderLookup.RegistryLookup original) {