Paper/Spigot-Server-Patches/0645-Empty-commands-shall-not-be-dispatched.patch
Riley Park 4e958e229f
We're going on an Adventure! (#4842)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-02-21 20:45:33 +01:00

19 lines
922 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/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java
index 22d748008d24fd6ed7cd8c4914e2ceb378f32c95..e56ff365118c50486f36cb15a4ca062c5a481674 100644
--- a/src/main/java/net/minecraft/server/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java
@@ -139,6 +139,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());