You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pc: Fix 1.21 enchant_item button id integer type to varint (#1201)
ServerboundContainerButtonClickPacket (minecraft-data packet_enchant_item) was reworked
in 1.21 to encode the button id as a VarInt. The vanilla codec is
StreamCodec.composite(CONTAINER_ID/VAR_INT, ::containerId, VAR_INT, ::buttonId). mcdata
updated windowId to ContainerID (varint) for 1.21+ but left enchantment (the button id)
as i8.
Before 1.21 both fields were a single byte (readByte/writeByte), so i8 is correct there;
this only affects 1.21.1-1.21.11.
A VarInt and a byte encode identically for button ids below 128, so it seldom breaks, but
a button id >= 128 (e.g. a stonecutter/loom recipe index on a server with many recipes)
needs a 2-byte VarInt that an i8 writer cannot represent. Serverbound.
Verified against the Mojang server jars: byte/byte in 1.19.4, VAR_INT button id in 1.21.1
and 1.21.3-1.21.9.
proto.yml edited, protocol.json regenerated with npm run build.
0 commit comments