game crashes when player joins world
cojalexandru opened this issue ยท 4 comments
Describe the bug
The game crashes when the world tries to create a chunk.
Version Info:
- Minecraft version: 1.6.5
- Forge version: 36.2.21
- Structure Gel API version: 1.7.8
- Dungeons Enhanced version 1.6
Additional context
From my knowledge it looks like you forgot to put a "=" here: https://github.com/BarionLP/DungeonsEnhanced/blob/1.16.5/src/main/java/com/barion/dungeons_enhanced/world/structures/prefabs/DEBaseStructure.java#L99
So instead of if (minY > maxY) {y = maxY;}
it would be if (minY >= maxY) {y = maxY;}
Because if it happens that minY and maxY are equal it would move to the next line and try to do random.nextInt(maxY - minY)
which would be random.nextInt(0)
which is going to throw the error that caused the crash.
Also the same thing with the nextInt()
method can happen at: https://github.com/BarionLP/DungeonsEnhanced/blob/1.16.5/src/main/java/com/barion/dungeons_enhanced/world/structures/prefabs/DEBaseStructure.java#L106