Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-131684

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 23w31a
    • Minecraft 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
    • Confirmed
    • Networking
    • Low

      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.

            Unassigned Unassigned
            pokechu22 [Mod] Pokechu22
            Votes:
            16 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: