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

Adding a biome to a datapack shifts biome IDs in existing chunks

    • Icon: Bug Bug
    • Resolution: Fixed
    • 21w38a
    • 20w30a, 1.16.3, 1.16.4 Release Candidate 1, 1.16.4, 20w46a, 21w03a, 1.16.5, 21w17a, 1.17.1
    • None
    • Confirmed
    • Custom Worlds
    • Normal

      When a datapack with custom biomes is loaded, the biomes it defines are assigned IDs according to their lexicographic order. When a new biome is added to an existing world but its name gets sorted anywhere else than at the end, it causes the biomes that follow it to shift. Chunks only store the resulting IDs in their biome maps and not the names, so they become corrupted, showing the biome that precedes the correct one.

       

      This can be quite easily fixed if chunks stored not only the biome IDs, but also a mapping that allowed retrieving the actual name, kinda like the block palette already works for a chunk section. Since there is usually only one biome per chunk, it's just a matter of storing one additional pair in the chunk data. This would also make it possible to define more than 256 biomes for a world.

          [MC-202036] Adding a biome to a datapack shifts biome IDs in existing chunks

          BBLZ added a comment -

          (@Dhranios)

          Fixed, game internals use biome name instead of whole biome list in code now

          BBLZ added a comment - (@Dhranios) Fixed, game internals use biome name instead of whole biome list in code now

          Seems fixed in the newest snapshot with the chunk format changes:

          Chunk’s Level.Biomes are now paletted and live in a similar container structure in Level.Sections[].biomes

          user-f2760 (Inactive) added a comment - Seems fixed in the newest snapshot with the chunk format changes: Chunk’s Level.Biomes are now paletted and live in a similar container structure in Level.Sections[].biomes

          Requesting the title to be changed to be a bit more accurate:
          1. only custom biome IDs get shifted
          2. vanilla adding biomes also shifts them
          3. mention the core issue
          Suggested title: Addition of new biomes shifts IDs of custom biomes from data packs due to missing ID mapping

          user-f2760 (Inactive) added a comment - Requesting the title to be changed to be a bit more accurate: 1. only custom biome IDs get shifted 2. vanilla adding biomes also shifts them 3. mention the core issue Suggested title: Addition of new biomes shifts IDs of custom biomes from data packs due to missing ID mapping

          Confirmed for 1.17.1.

          user-f2760 (Inactive) added a comment - Confirmed for 1.17.1.

          Starmute added a comment -

          I've added two versions of a datapack which can be used for testing purposes. Install v3.0.3 first, load some chunks in the Nether, and then delete it and install v3.1.

          Starmute added a comment - I've added two versions of a datapack which can be used for testing purposes. Install v3.0.3 first, load some chunks in the Nether, and then delete it and install v3.1.

          Starmute added a comment -

          Affects 1.16.4-RC

          Starmute added a comment - Affects 1.16.4-RC

          Please add a datapack/steps to reproduce

          [Mod] tryashtar added a comment - Please add a datapack/steps to reproduce

          IonicEcko added a comment -

          IllidanS4 I've moved the report.

          Can you please check the affected version and update if needed.

          IonicEcko added a comment - IllidanS4 I've moved the report. Can you please check the affected version and update if needed.

          But otherwise, this will be resolved as invalid by a mod

          Chungui23 (Inactive) added a comment - But otherwise, this will be resolved as invalid by a mod

          No, but you can tell the mods to move to the right project

          Chungui23 (Inactive) added a comment - No, but you can tell the mods to move to the right project

            Unassigned Unassigned
            IllidanS4 IllidanS4
            Votes:
            66 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: