diff options
Diffstat (limited to 'patches/server/0851-Kick-on-main-for-illegal-chars.patch')
-rw-r--r-- | patches/server/0851-Kick-on-main-for-illegal-chars.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0851-Kick-on-main-for-illegal-chars.patch b/patches/server/0851-Kick-on-main-for-illegal-chars.patch new file mode 100644 index 0000000000..f5c7e34afc --- /dev/null +++ b/patches/server/0851-Kick-on-main-for-illegal-chars.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke <[email protected]> +Date: Mon, 17 Jan 2022 19:47:19 +0100 +Subject: [PATCH] Kick on main for illegal chars + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index cb5df601391a05c1c7cfc1c5d86043f89d673407..dea4d455d05945505f9ef33793a61783b521bf11 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -2077,7 +2077,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser + + for (int i = 0; i < s.length(); ++i) { + if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) { ++ this.server.scheduleOnMain(() -> { // Paper - push to main for event firing + this.disconnect(new TranslatableComponent("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause ++ }); // Paper - push to main for event firing + return; + } + } |