From 17a73dff8229cec8177089f1ae59a72470c90643 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 4 Dec 2024 15:23:56 +0100 Subject: [PATCH] Handle set_player_inventory --- .../rewriter/BlockItemPacketRewriter1_21_4.java | 1 + .../com/viaversion/viaversion/rewriter/ItemRewriter.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_21_2to1_21_4/rewriter/BlockItemPacketRewriter1_21_4.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_21_2to1_21_4/rewriter/BlockItemPacketRewriter1_21_4.java index 3f1983321..8e4bd1b24 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_21_2to1_21_4/rewriter/BlockItemPacketRewriter1_21_4.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_21_2to1_21_4/rewriter/BlockItemPacketRewriter1_21_4.java @@ -65,6 +65,7 @@ public final class BlockItemPacketRewriter1_21_4 extends StructuredItemRewriter< protocol.cancelServerbound(ServerboundPackets1_21_4.PICK_ITEM_FROM_ENTITY); protocol.registerClientbound(ClientboundPackets1_21_2.SET_CURSOR_ITEM, this::passthroughClientboundItem); + registerSetPlayerInventory(ClientboundPackets1_21_2.SET_PLAYER_INVENTORY); registerCooldown1_21_2(ClientboundPackets1_21_2.COOLDOWN); registerSetContent1_21_2(ClientboundPackets1_21_2.CONTAINER_SET_CONTENT); registerSetSlot1_21_2(ClientboundPackets1_21_2.CONTAINER_SET_SLOT); diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java b/common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java index 1cf80acbd..d0f5e96be 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java @@ -231,6 +231,13 @@ public class ItemRewriter { + wrapper.passthrough(Types.VAR_INT); // Slot + passthroughClientboundItem(wrapper); + }); + } + public void registerCooldown(C packetType) { protocol.registerClientbound(packetType, wrapper -> { int itemId = wrapper.read(Types.VAR_INT);