2022-01-18 07:16:36 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <jahnke.nassim@gmail.com>
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
2022-02-12 13:20:33 +00:00
index 0c87166beb89dd220e2f7aed1c47a331297eef0d..d945a22e2bb992f3cbba3c9ed0f660b6a385a1b0 100644
2022-01-18 07:16:36 +00:00
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
2022-02-12 13:20:33 +00:00
@@ -2069,7 +2069,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
2022-01-18 07:16:36 +00:00
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;
}
}