From db2177466fd7e2b1bf4d68665d95a7e02575f8de Mon Sep 17 00:00:00 2001 From: skbeh <60107333+skbeh@users.noreply.github.com> Date: Sat, 14 Sep 2024 11:13:57 +0000 Subject: [PATCH] fix: apply message in `PlayerChatEvent` when handling `SessionPlayerChatPacket` (#1411) Fix 1.19.3+ unsigned chat not being changed by `PlayerChatEvent`. --- .../proxy/protocol/packet/chat/session/SessionChatHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/session/SessionChatHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/session/SessionChatHandler.java index 0731f64ed4..74b5747f92 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/session/SessionChatHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/session/SessionChatHandler.java @@ -71,7 +71,8 @@ public void handlePlayerChatInternal(SessionPlayerChatPacket packet) { invalidChange(logger, player); return null; } - return this.player.getChatBuilderFactory().builder().message(packet.message) + return this.player.getChatBuilderFactory().builder() + .message(chatResult.getMessage().orElse(packet.getMessage())) .setTimestamp(packet.timestamp) .setLastSeenMessages(newLastSeenMessages) .toServer();