From bf7ed14506de81a5270249ec3334e786e97fbd41 Mon Sep 17 00:00:00 2001 From: Gero Date: Sat, 27 Apr 2024 21:31:49 +0200 Subject: [PATCH] Fix remapping of 1.20.5 CLICK_WINDOW_BUTTON --- .../rewriter/BlockItemPacketRewriter1_20_5.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java index 1cb2ad35..b7d65b59 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java @@ -66,10 +66,10 @@ public final class BlockItemPacketRewriter1_20_5 extends BackwardsStructuredItem registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_5.WINDOW_PROPERTY); registerCreativeInvAction(ServerboundPackets1_20_3.CREATIVE_INVENTORY_ACTION); protocol.registerServerbound(ServerboundPackets1_20_3.CLICK_WINDOW_BUTTON, wrapper -> { - final int containerId = wrapper.read(Type.VAR_INT); - final int buttonId = wrapper.read(Type.VAR_INT); - wrapper.write(Type.BYTE, (byte) containerId); - wrapper.write(Type.BYTE, (byte) buttonId); + final int containerId = wrapper.read(Type.BYTE) & 0xFF; + final int buttonId = wrapper.read(Type.BYTE) & 0xFF; + wrapper.write(Type.VAR_INT, containerId); + wrapper.write(Type.VAR_INT, buttonId); }); protocol.registerClientbound(ClientboundPackets1_20_5.SPAWN_PARTICLE, wrapper -> {