mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
Added 1.19 kick event causes (#8204)
This commit is contained in:
@@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
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"));
|
||||
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 {
|
||||
if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) {
|
||||
@@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (!this.updateChatOrder(timestamp)) {
|
||||
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message);
|
||||
+ this.server.scheduleOnMain(() -> { // Paper - push to main
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"));
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event cause
|
||||
+ }); // Paper - push to main
|
||||
return false;
|
||||
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
|
||||
|
Reference in New Issue
Block a user