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

RegistryFileCodecs are improperly used with Biomes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20, 1.20.2, 23w45a
    • None
    • Confirmed
    • Data Packs, World generation
    • Low
    • Platform

      Minecraft defines many datatype codecs through RegistryFileCodec, which allows elements to be inlined rather than defined by their key.

      This is improperly used for Biomes, which causes cases where inlined (not registered) Biomes are passed around in the world.
       
      For example, the data pack below generates a world with an inlined biome. 
      This causes many issues, as HashMapPalette expects each instance to be registered by a registry, and due to it being inlined, it returns an invalid value.

      Impact:
      This also causes many issues due to the fact that these biomes are not synchronized with the client.
       
      In general, there are many uses where inlining is truly useful... especially in cases where it does not depend on synchronization here.
       
      The proper solution would be to most likely not allow inlining biomes via their Codec, or for allowInlineDefinitions to be false.

      How to reproduce

      1. Create a new world and add the attached data pack TestDims.zip
      2. Notice that the data pack validates fine and the world starts generating
      3. After spawning in, run:
        /execute in machine_maker:world run tp @s ~ ~ ~
        
      1. The game softlocks as the chunks fail to load in and lots of errors are logged.

            Unassigned Unassigned
            Owen1212055 Owen
            Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: