From edf9ccca8ba0b5cad14a9f91d0cfde789e35c8bc Mon Sep 17 00:00:00 2001 From: KennyTV Date: Fri, 18 Jun 2021 17:26:32 +0200 Subject: [PATCH] Uncache state ids on inventory close --- .../Protocol1_17To1_17_1.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17to1_17_1/Protocol1_17To1_17_1.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17to1_17_1/Protocol1_17To1_17_1.java index d6642824..79240681 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17to1_17_1/Protocol1_17To1_17_1.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17to1_17_1/Protocol1_17To1_17_1.java @@ -41,6 +41,15 @@ public final class Protocol1_17To1_17_1 extends BackwardsProtocol { + short containerId = wrapper.passthrough(Type.UNSIGNED_BYTE); + wrapper.user().get(InventoryStateIds.class).removeStateId(containerId); + }); + } + }); registerClientbound(ClientboundPackets1_17.SET_SLOT, new PacketRemapper() { @Override public void registerMap() { @@ -68,6 +77,15 @@ public final class Protocol1_17To1_17_1 extends BackwardsProtocol { + short containerId = wrapper.passthrough(Type.UNSIGNED_BYTE); + wrapper.user().get(InventoryStateIds.class).removeStateId(containerId); + }); + } + }); registerServerbound(ServerboundPackets1_17.CLICK_WINDOW, new PacketRemapper() { @Override public void registerMap() {