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 ea8e9427e..ab0d70f2d 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java @@ -112,20 +112,22 @@ public class ItemRewriter { - final int windowType = wrapper.read(Types.VAR_INT); - final int mappedId = protocol.getMappingData().getMenuMappings().getNewId(windowType); - if (mappedId == -1) { - wrapper.cancel(); - return; - } - - wrapper.write(Types.VAR_INT, mappedId); - }); + handler(wrapper -> handleMenuType(wrapper)); } }); } + public void handleMenuType(final PacketWrapper wrapper) { + final int windowType = wrapper.read(Types.VAR_INT); + final int mappedId = protocol.getMappingData().getMenuMappings().getNewId(windowType); + if (mappedId == -1) { + wrapper.cancel(); + return; + } + + wrapper.write(Types.VAR_INT, mappedId); + } + public void registerSetSlot(C packetType) { protocol.registerClientbound(packetType, new PacketHandlers() { @Override