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

New PalettedContainer deserialization eliminates duplicate palette entries


    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 21w39a
    • None
    • Confirmed
    • (Unassigned)

      The old PalettedContainer deserialization process called Palette#read(ListTag) to initialise the palette object's ids. This read method did not eliminate duplicates.


      The new PalettedContainer deserialization process now calls Palette#idFor for each palette entry - this of course will eliminate duplicates.


      The elimination of duplicates will cause the chunk to error upon loading, or at worst will destroy the chunk's data due to the palette ids possibly being shifted down (due to an elimination of an entry) by 1 or more. It could also have zero effect.


      The vast majority of chunks do not have invalid palette data, but some do (ancient chunks? stupid mods?). And these chunks cannot be loaded in the snapshot now, whereas on 1.17.1 they load and operate completely fine.


      Exception of me attempting to load an old world (Can't post the world): https://gist.github.com/Spottedleaf/2419b8bba4aef3e1f982737f5795e42e

            Unassigned Unassigned
            Spottedleaf Spottedleaf
            14 Vote for this issue
            9 Start watching this issue