Amulet-Core icon indicating copy to clipboard operation
Amulet-Core copied to clipboard

Rewrite Dimension Logic

Open gentlegiantJGC opened this issue 3 years ago • 0 comments

There are a number of issues with how we handle dimensions and it needs fixing.

Here is my research so far

Java
	forge
		1.12
			level.dat["forge"]["DimensionData"]["UsedIDs"] = [I;0, 1, 7]
				an int array of the biomes that are used.
				This relates to the DIM{X} format.
				Not sure what the 0 and 1 are for.
			
			boss data
			level.dat["Data"]["DimensionData"] = {"7": {"CustomSeed": 0L}}
			
			level.dat["Data"]["Player"]["Dimension"] = 7
				-1 = the nether
				0 = overworld
				1 = the end
		1.16
			seems to use the vanilla system
	vanilla
		before 1.16 could not have custom biomes
		1.16
			level.dat["Data"]["WorldGenSettings"]["dimensions"] = {"namespace:basename": {...}, "minecraft:overworld": {...}, ...}
				keys are string dimension ids.
						It looks like the dimension data is stored in "./dimensions/namespace/basename"
			player "Dimension" is a string
		1.17
			adds customisable min and max height values in the generator settings

Bedrock has always been numerical. 0, 1, 2 for overworld, nether and end respectively. It doesn't yet have custom dimensions.

The main issue I see is managing the switch between the numerical and namespaced string system. We will need to look up the dimension in newer versions based on both the numerical and namespaced formats. This means the translation/interface logic will need reworking so that it has access to this information. When saving back entity data the dimension entry will need patching to the correct value.

gentlegiantJGC avatar May 27 '21 10:05 gentlegiantJGC