From 83223c152062b6a6ebf8ae1864dd1e66819b47f9 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 7 Apr 2024 20:35:07 +0200 Subject: [PATCH] Also handle ack in serverbound chat message --- .../Protocol1_20_5To1_20_3.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java index fbaed65bc..75d292e5b 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java @@ -92,6 +92,8 @@ public final class Protocol1_20_5To1_20_3 extends AbstractProtocol { wrapper.passthrough(Type.UUID); // Sender wrapper.passthrough(Type.VAR_INT); // Index @@ -108,7 +110,17 @@ public final class Protocol1_20_5To1_20_3 extends AbstractProtocol wrapper.user().get(AcknowledgedMessagesStorage.class).clearOffset()); + registerServerbound(ServerboundPackets1_20_5.CHAT_MESSAGE, wrapper -> { + wrapper.passthrough(Type.STRING); // Message + wrapper.passthrough(Type.LONG); // Timestamp + wrapper.passthrough(Type.LONG); // Salt + wrapper.passthrough(Type.OPTIONAL_SIGNATURE_BYTES); // Signature + + // Remove original acknowledgement + wrapper.read(Type.VAR_INT); // Offset + wrapper.read(Type.ACKNOWLEDGED_BIT_SET); // Acknowledged + writeChatAck(wrapper); + }); registerServerbound(ServerboundPackets1_20_5.CHAT_COMMAND_SIGNED, ServerboundPackets1_20_3.CHAT_COMMAND, wrapper -> { wrapper.passthrough(Type.STRING); // Command wrapper.passthrough(Type.LONG); // Timestamp