1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2024-12-21 22:15:18 +01:00
PaperMC/patches/server/0459-Empty-commands-shall-not-be-dispatched.patch
2024-12-05 12:20:56 +01:00

18 lines
883 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/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index b34abf66c7dc756e88e08637af976f7794144d06..2dcb1a1bdba1d1cad3caa117d85a8619ed9e67b4 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -291,6 +291,7 @@ public class Commands {
command = event.getCommand();
String[] args = command.split(" ");
+ if (args.length == 0) return; // Paper - empty commands shall not be dispatched
String cmd = args[0];
if (cmd.startsWith("minecraft:")) cmd = cmd.substring("minecraft:".length());