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

Deleting then Restoring a Custom Dimension Removes NBT Data used to register the dimension

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • 1.16.5
    • None
    • Java Version: Version 8 Build 271
    • Unconfirmed
    • (Unassigned)

      Issue Description

      When a custom dimension is added to an existing world, removed, and then readded, the NBT data used to register the dimension is lost.

       

      This is important because the game does not keep track of all dimensions, which means when a world is upgraded to a newer version of Minecraft, there can be unseen complications when loading the custom dimension in the upgraded world.

      Reproduction Steps:

      1. Create a new Minecraft workspace using version 1.16.5.
      2. Load the workspace in Debug Mode so breakpoints can be added later.
      3. Create a new world in 1.16.5 vanilla
      4. Save and Quit to Title Screen
      5. Add a datapack containing a custom dimension to the existing world we previously created.
      6. Load the world, and select the "Create a Backup and Load Option" when the WorldOption screen is displayed.
      7. Verify the custom dimension was added via the
        /execute in

        command suggestions.

      1. Teleport to the custom dimension to load it.
      1. This can be done via the
        /execute in

        command.

      1. Place blocks in the dimension to allow it to have different chunk data.
      1. Save and Quit to Title Screen
      2. Remove the datapack from the world.
      3. Add breakpoint to Line 908 of SaveFormat.java. The line of code is 
        Dynamic<T> dynamic1 = fixer.update(TypeReferences.WORLD_GEN_SETTINGS, dynamic, version, SharedConstants.getVersion().getWorldVersion());
        1. The above names are MCP names, let me know if you need Mojang Mapping names
      1. Load the world that now has the datapack removed.
      2. See that the nbt data in the CompountNBT tagMap inside the
         Dynamic<T> 

        at your break point contains the custom dimension alongside the other vanilla dimensions.

      1. Continue to step through until the WorldOptions screen is displayed.
      1. Click the “Create Backup and Load” option at the World Options Screen.
      2. See that you will be teleported to the Overworld now that the datapack dimension was removed.
      3. Save and Quit to World
      4. Readd datapack dimension into world save
      5. Reopen World Save
      6. See that only vanilla dimensions (In this case the Overworld) are present in the CompountNBT tagMap of Dynamic<T> dynamic1 (Line 98 of SaveFormat.java)
        1. The reason only the Overworld is present is because of another outstanding vanilla bug, https://bugs.mojang.com/browse/MC-197860 .
      7. We can now see that NBT DATA FOR CUSTOM DIMENSIONS ARE “MISSING” after the custom dimension is readded.

      Tools Used:

      Additional Information:

      Full writeup of reproduction test procedure and tools used can be seen in my document:

      https://drive.google.com/file/d/1WkcHXeM5BW_Li5gH_h-p_3wF3kX-OQ4s/view?usp=sharing 

            Unassigned Unassigned
            50ap5ud5 50ap5ud5
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: