Fabric API

Fabric API

108M Downloads

Fabric API breaks Custom Dimensions

Philainel opened this issue ยท 6 comments

commented

I'm building a datapack with custom dimensions (including custom biome & noise settings). Once i noticed that if i rejoin world, the custom dimensions disappear. I've investigated that dimensions disappear from level.dat file as soon as I open world from game or starting the server.
This behavior doesn't applies for vanilla / paper / fabric without fabric-api.
I know that this features are experimental, but I hope it will be fixed later.

commented

Please link a datapack that we can use to reproduce. Do also mention your MC version.

commented

AFAIK this is deliberate to workaround this bug: https://bugs.mojang.com/browse/MC-197860

See:
https://github.com/FabricMC/fabric/blob/1.19.3/fabric-dimensions-v1/src/main/java/net/fabricmc/fabric/mixin/dimension/LevelStorageMixin.java

Although the dimension is not mentioned in level.dat it should still be usable.
Provided there is a datapack/mod loaded defining the dimension.

commented

@Technici4n yep, Minecraft version 1.19.3, fabric-api version 0.70.0
DiPixDatapack.1672251286.zip

commented

@warjort I am not deleting any dimension, so i don't think that bug refers to this issue.
Btw dimension files stay in world folder but /execute in namespace:dimension can't find them

commented

When I tried to fix the issue of cannot enter world after removing dimension mod, I provided two solutions.
The first one is simple, remove non-vanilla dimensions when reading level data. Because in 1.18.x the custom dimensions are added once the datapack loads, so the dimensions will be re-added and that won't cause issue. However there is now world preset and its dimension is not added every time when loading the world.

My original second solution is more complex: it makes deserialization fault-tolerant. Vanilla has a system of checking "dangling reference" when freezing registry which should also be considered. It's also Forge's solution to this issue.

I am going to remove the original simple solution and use the second solution.

commented

Fixed by #2856.