testserver/Spigot-Server-Patches/0644-Empty-commands-shall-n...

19 lines
930 B
Diff
Raw Normal View History

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());