3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-25 15:50:06 +01:00
Paper/Spigot-Server-Patches/0644-Empty-commands-shall-not-be-dispatched.patch
Mariell Hoversholm 0f78e95250 More work
2021-03-18 18:03:22 +01:00

19 Zeilen
930 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mariell Hoversholm <proximyst@proximyst.com>
Date: Wed, 6 Jan 2021 23:38:43 +0100
Subject: [PATCH] Empty commands shall not be dispatched
diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java
index 77d3712390125601d964519c3df9928ea3a7caf0..9d37d0c4af89469421dbdf47075612288cfa17c9 100644
--- a/src/main/java/net/minecraft/commands/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java
@@ -222,6 +222,7 @@ public class CommandDispatcher {
command = event.getCommand();
String[] args = command.split(" ");
+ if (args.length == 0) return 0; // Paper - empty commands shall not be dispatched
String cmd = args[0];
if (cmd.startsWith("minecraft:")) cmd = cmd.substring("minecraft:".length());