Paper/Spigot-Server-Patches/0645-Empty-commands-shall-not-be-dispatched.patch

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
2021-03-16 16:50:45 +01:00
index 07d3dec9f613013aac72f3f5db17089ebe5ee770..a70e0761aeddee8fafff971b5cbd0422ab560fb5 100644
--- a/src/main/java/net/minecraft/commands/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java
2021-03-16 16:50:45 +01:00
@@ -223,6 +223,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());