PlayerKickEvent triggered on wrong thread #7362
Labels
status: accepted
Disputed bug is accepted as valid or Feature accepted as desired to be added.
type: bug
Something doesn't work as it was intended to.
version: 1.18
Game version 1.18
Expected behavior
Bedrock Edition players can enter some characters that are considered illegal on Java Editions, so whenever player sends such characters they are supposed to be disconnected with reason
multiplayer.disconnect.illegal_characters
.Observed/Actual behavior
Paper specifies the cause for disconnect — a kick. This causes it to try and fire PlayerKickEvent, however, it can only be triggered on the main thread, while the chat is handled on a separate thread, which results in an IllegalStateException. This still disconnects the player but does not show them a meaningful message, instead, they see ‘Internal Exception: java.lang.IllegalStateException: PlayerKickEvent may only be triggered synchronously.’
Steps/models to reproduce
The easiest way is to install Geyser and Floodgate plugin, then to connect to the server using Bedrock Edition and simply send § paragraph character, which is illegal on Java.
Plugin and Datapack List
Plugins (3): floodgate, Geyser-Spigot, ProtocolLib
Paper version
[19:25:52 INFO]: Checking version, please wait...
[19:25:53 INFO]: This server is running Paper version git-Paper-155 (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT) (Git: 99cf01f)
You are running the latest version
Other
Related LOC:
Paper-Server/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java:2070
Debug stack trace
The text was updated successfully, but these errors were encountered: