Realistic Terrain Generation

Realistic Terrain Generation

3M Downloads

ConcurrentModificationException | RTG + Enviromine

srs-bsns opened this issue ยท 3 comments

commented
java.util.ConcurrentModificationException
    at java.util.HashMap$HashIterator.nextNode(Unknown Source) ~[?:1.8.0_74]
    at java.util.HashMap$ValueIterator.next(Unknown Source) ~[?:1.8.0_74]
    at net.minecraft.world.gen.structure.MapGenStructure.func_75051_a(MapGenStructure.java:89) ~[ave.class:?]
    at rtg.world.gen.ChunkProviderRTG.func_73153_a(ChunkProviderRTG.java:661) ~[ChunkProviderRTG.class:?]
    at net.minecraft.world.gen.ChunkProviderServer.func_73153_a(ChunkProviderServer.java:279) ~[ms.class:?]
    at net.minecraft.world.chunk.Chunk.func_76624_a(Chunk.java:1055) ~[apx.class:?]
    at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:190) ~[ms.class:?]
    at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:131) ~[ms.class:?]
    at net.minecraft.world.gen.ChunkProviderServer.func_73158_c(ChunkProviderServer.java:101) ~[ms.class:?]
    at net.minecraft.server.MinecraftServer.func_71222_d(MinecraftServer.java:265) ~[MinecraftServer.class:?]
    at net.minecraft.server.integrated.IntegratedServer.func_71247_a(IntegratedServer.java:78) ~[bsx.class:?]
    at net.minecraft.server.integrated.IntegratedServer.func_71197_b(IntegratedServer.java:92) ~[bsx.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:387) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) [?:?]

Mods loaded: RTG-1.7.10-0.6.2, EnviroMine-1.3.124

Steps to reproduce:
10 In RTG.cfg set the village generation to ridiculous levels (all other config setting are default):

    I:"Maximum distance between villages"=8
    I:"Minimum distance between villages"=2

20 Create a new world
30 If the game doesn't crash when creating spawn, exit to menu
40 goto 20

With normal village gen settings this crash will still happen, it will just take forever to trigger it.

I also reproduced this with RTG 0.5.0 and RTG 0.6.0, so if this is somehow RTG's fault, it's not something new.

I was unable to reproduce this without Enviromine being present.

Edit:
I am unable to reproduce this with B:"Enable Village MineShafts" set to false in /config/enviromine/Global_Settings.cfg

Not every instance of a village mineshaft causes this exception. (I saw plenty of villages with mineshafts without crashing.)

There is no way to reproduce this 100%. Under normal circumstances (default village gen) if you encounter this bug and create a new world with the same seed, travel to the same coordinates that the crash occured, there's no guarantee that it will occur again.

commented

Ok... because of the nondeterministic nature of this issue (and because it only seems to be an issue when EnviroMine is installed), I've added a config option called "Village Crash Fix" which defaults to false (unless EnviroMine is installed, in which case it defaults to true).

If true, RTG basically just catches the exception before it crashes and carries on with its business.

I'm assuming this prevents the broken village from generating, and thus prevents the broken village mineshaft from EM from generating as well, but I haven't been able to confirm exactly what's happening with the broken villages.

All I know is... I've tested two seeds which were crashing on world load, and with the config option set to true, everything seems to work fine. Villages still generate, and EM's village mineshafts still generate.

Here's what I changed in the CME branch: dev...ConcurrentModificationException

And here's a snapshot if anyone wants to give it a test drive: https://goo.gl/Bd1Dsr

commented

There is no way to reproduce this 100%. Under normal circumstances (default village gen) if you encounter this bug and create a new world with the same seed, travel to the same coordinates that the crash occured, there's no guarantee that it will occur again.

Par for the course with concurrency problems. They're normally nondeterministic.

commented

Fixed in cdc29ba