3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/patches/server/0549-Send-empty-commands-if-tab-completion-is-disabled.patch
Owen 89d51d5f29
Allow enabling sand duping (#10191)
Because this exploit has been widely known for years and has not been fixed by Mojang, we decided that it was worth allowing people to toggle it on/off due to how easy it is to make it configurable.

It should be noted that this decision does not promise all future exploits will be configurable.
2024-03-03 17:05:34 -05:00

25 Zeilen
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 26 Apr 2021 01:27:08 +0100
Subject: [PATCH] Send empty commands if tab completion is disabled
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 0741c0f85536c5188d8552e999943a9c771a548e..c11977dceeba4120cdb63972c4ec486640d8114e 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -455,7 +455,12 @@ public class Commands {
}
public void sendCommands(ServerPlayer player) {
- 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