mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-17 02:34:30 +01:00
remove redundant patch
This commit is contained in:
parent
93dcf918f8
commit
5db582ae19
1 changed files with 0 additions and 44 deletions
|
@ -1,44 +0,0 @@
|
||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Nassim Jahnke <nassim@njahnke.dev>
|
|
||||||
Date: Mon, 17 Jan 2022 19:47:19 +0100
|
|
||||||
Subject: [PATCH] Kick on main for illegal chat
|
|
||||||
|
|
||||||
Makes the PlayerKickEvent fire on the main thread for
|
|
||||||
illegal characters or chat out-of-order errors.
|
|
||||||
|
|
||||||
TODO: Check all the missing schedule on mains? (1.20.3)
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) {
|
|
||||||
+ this.server.scheduleOnMain(() -> { // Paper - push to main for event firing
|
|
||||||
this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause
|
|
||||||
+ }); // Paper - push to main for event firing
|
|
||||||
} else {
|
|
||||||
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.lastSeenMessages());
|
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
||||||
@Override
|
|
||||||
public void handleChatCommand(ServerboundChatCommandPacket packet) {
|
|
||||||
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) {
|
|
||||||
+ this.server.scheduleOnMain(() -> { // Paper - push to main for event firing
|
|
||||||
this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper
|
|
||||||
+ }); // Paper - push to main for event firing
|
|
||||||
} else {
|
|
||||||
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.lastSeenMessages());
|
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
||||||
private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
|
|
||||||
ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString());
|
|
||||||
if (exception.shouldDisconnect()) {
|
|
||||||
+ this.server.scheduleOnMain(() -> { // Paper - push to main
|
|
||||||
this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes
|
|
||||||
+ }); // Paper - push to main
|
|
||||||
} else {
|
|
||||||
this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED));
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue