mojira.dev
MC-255158

Deleting/disabling a custom dimension along with its custom worldgen settings prevents world from loading

  • Create a datapack that has a dimension json and a dimensiontype referred to by that dimension

  • Create a world using that datapack and verify that the dimension exists

  • Close world

  • Remove datapack from world

  • Attempt to start the world again

  • The following error happens when loading datapacks:

```

[Render thread/WARN]: Failed to load datapacks, can't proceed with server load
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Unbound values in registry ResourceKey[minecraft:root / minecraft:dimension_type]: [dimension_removal:fake_nether]
```

A datapack capable of reproducing this is attached, as well as a log from a session where I performed the above steps (creating a singleplayer world with the datapack, leaving, removing the datapack, and rejoining).

 

Possible cause: The dimension json is stored in the level.dat file, which is retained when the dimension json is removed. When the level.dat parser attempts to parse the dimension again, the dimension parser reads the dimensiontype id and adds an unbound dimensiontype holder to the server's dimensiontype registry. No dimensiontype by that id is ever loaded or bound to that holder, so the above error happens when the server's worldgen registries freeze shortly afterward. I believe this would also happen for missing biomes or other worldgen json files referred to by the removed dimension json but have only tested this with missing dimensiontypes.

Linked issues

Attachments

Comments 1

Confirmedfor 1.20.2 too.
Possible fix: dimensions themselves are written to level.dat allowing them to be loaded when the dimension json file is gone; the same can be done for dimension types.

Commoble

(Unassigned)

Confirmed

(Unassigned)

1.18.2, 22w12a, 1.19 Pre-release 1, 1.19, 1.19.2, 1.20.2, 23w43b

Retrieved