Mojira Archive
MC-131684

Chunk data packet allocates an extra byte for each section using GlobalPalette

The direct palette in the chunk data packet no longer writes anything to the packet buffer (instead of just writing a 0); this changed in 17w47a (the flattening). However, they still claim to have a serialized size of 1 byte. This means that the buffer allocated for the chunk data packet has between 1 and 16 extra bytes, one for the palette for each chunk section using the global palette.

In 1.12.2, what MCP calls BlockStatePaletteRegistry has this:

    public void read(PacketBuffer buf)
    {
        buf.readVarInt();
    }

    public void write(PacketBuffer buf)
    {
        buf.writeVarInt(0);
    }

    public int getSerializedSize()
    {
        return PacketBuffer.getVarIntSize(0);
    }

In the current 1.13 snapshots, it instead has this:

    public void read(PacketBuffer buf)
    {
    }

    public void write(PacketBuffer buf)
    {
    }

    public int getSerializedSize()
    {
        return PacketBuffer.getVarIntSize(0);
    }

The return PacketBuffer.getVarIntSize(0) should be changed to return 0.

Fixed

[Mod] Pokechu22

2018-06-20, 12:37 AM

2023-08-06, 05:56 AM

2023-08-06, 05:56 AM

16

12

Confirmed

Low

Networking

packet

Minecraft 1.13-pre2 - 1.18.1Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre9, Minecraft 1.13, Minecraft 18w30a, Minecraft 18w30b, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w43b, 1.15.1, 1.15.2, 1.16.3, 1.17.1, 21w37a, 1.18.1

23w31a