Invalid Dimension ID crash upon reaching 100 dimensions

Published by luxluxdev on
Status
Fixed
Issue description

I've done some research but nothing found, so I have no idea if this is a MCreator bug or a Minecraft limitation. Upon reaching 100+ dimensions created, even tho gradle compiles succesfully, launching the game (either in test environment or exported) will cause an exception:

Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Any Dimension Mod (any_dimension_mod)
Caused by: java.lang.IllegalArgumentException: Invalid dimension id 141218099
	at net.minecraft.world.DimensionType.func_186069_a(DimensionType.java:77)
	at net.minecraftforge.common.DimensionManager.registerDimension(DimensionManager.java:131)
	at mod.mcreator.mcreator_d099terracotta11.preInit(mcreator_d099terracotta11.java:108)
	at mod.mcreator.any_dimension_mod.lambda$preInit$4(any_dimension_mod.java:81)
	at mod.mcreator.any_dimension_mod$$Lambda$86/749948446.accept(Unknown Source)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at mod.mcreator.any_dimension_mod.preInit(any_dimension_mod.java:79)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        ...

My dimension IDS go from 141218000 to 141218150, but the actual value of the id doesn't matter, because if i delete, say, the dimension with id 141218050, then 141218099 won't cause the exception but the next one (id 141218100) will. In other words, I've noticed it's always the dimension at the 100th spot (the 100th dimension) that causes the crash.

Does Minecraft limit the amount of possible dimensions? Or is this a bug in MCreator? I know that dimension IDs can span the entire integer range (unlike something like biome IDs) so I'm sure the ID values aren't what I'm doing wrong here..

Would love to see this working because my mod has a total 157 dimensions.

Issue comments

I suggest you to use lower dimension IDs as such big IDs could cause problems. There could be a limit to but I am not aware of any. This is not MCreator bug as we don't limit the number of dimensions and the error you pasted is thrown by Minecraft Forge, so it could be bug or limitation on their side.

We plan to add custom dimension ID dial in the future updates too: https://mcreator.net/tracker/issue/46774

I've tried using much lower dimension IDs but it seems that Forge still crashes at exactly the 100th dimension, no matter what. I guess it's either a bug or limit on MC/Forge's side.. Thanks for the reply though! I will have to strip away most of my dimensions then..

I seem to get this error no matter what I call the DIM id, it usually says 2 anyway in the crash file, sometimes it may say 66, which i named it, others not, but it won't start up with other dimensions in the same modpack