Railcraft

Railcraft

34M Downloads

Geode worldgen + mystcraft can cause infinite loop

chylex opened this issue ยท 2 comments

commented

Hello, I have an interesting conflict here which I'm reporting for @sciguyryan. Mystcraft apparently generates a temporary dimension, and it seems that it uses an ocean/water biome, which causes GeodePopulator.canGen#L71 to trigger.

Then GeodePopulator.isWaterDeep#L109 detects water using the block material, which allows flowing water and modded water-like blocks to pass the test. However in GeodePopulator.getWaterDepth#L89, this test checks directly Blocks.water, and it doesn't stop if it reaches maximum world height.

This appears to be causing an infinite loop, where the code detected some kind of water in the biome, but it's not vanilla stationary water.

Here is the critical part of the server thread dump:

at mods.railcraft.common.worldgen.GeodePopulator.getWaterDepth(GeodePopulator.java:87)
at mods.railcraft.common.worldgen.GeodePopulator.generateGeode(GeodePopulator.java:63)
at mods.railcraft.common.worldgen.GeodePopulator.generate(GeodePopulator.java:56)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_227_GeodePopulator_generate_Pre.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)
at com.xcompwiz.mystcraft.world.ChunkProviderMyst.func_73153_a(ChunkProviderMyst.java:151)

and the full thread dump, in case that isn't enough (line 290): http://pastebin.com/C6T0zYY3

Mod versions mentioned in the stack trace: RailCraft 9.5.0.9 (beta), Mystcraft 0.11.4.00, Fastcraft 1.21

If you have any questions about the other mods, please approach @sciguyryan directly (mentioning him in a reply here should be fine).

EDIT: Additional information, it appears this bug has been introduced at the end of February, in this commit: Fix for Geode gen

commented

I'll give a fix soon.

commented

I would also suggest changing "block == Blocks.water" to "block.getMaterial() == Material.water", or making the original material check a block check instead, that seems to be the main cause of the issue and having the Y capped would be just an extra precaution. Anyways, thanks for fixing it either way.

Linking to #578 and closing the issue.