Skip to content

ItemStatePacketRegistry

Registers ItemStatePacket/ItemUpdatePacket handlers with ArchieNetworkChannel - the net.kernelpanicsoft.archie.gui.blockentity.BlockEntityStatePacketRegistry equivalent for item-backed menus.

Unlike the block-entity path, routing needs no position-keyed lookup on either side - an item-backed menu is inherently 1:1 with one player's session, so "the current menu" is always just context.player.containerMenu (true on both sides: net.minecraft.world.entity.player.Player has exactly one open net.minecraft.world.inventory.AbstractContainerMenu at a time). The containerId on each packet is checked purely as a staleness guard against a stray packet arriving after the player closed one item menu and opened another - a mismatch is silently dropped, not an error.

Functions

register

fun register()

Registers the clientbound and serverbound packet handlers described above.