Jump to content

ConcurrentModificationException while spawning structures in a chunk.


Recommended Posts

Posted

Getting the following error when working with Structures...

 

The only thing I found when searching this site and google are when people are spawning entities in the client thread, nothing about Structures spawning in a chunk.

 

Any ideas? Thanks.

 

 

 

2012-09-30 14:40:35 [iNFO] [sTDERR] java.util.ConcurrentModificationException
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at java.util.HashMap$ValueIterator.next(Unknown Source)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.MapGenStructure.generateStructuresInChunk(MapGenStructure.java:47)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at micdoodle8.mods.galacticraft.GCChunkProvider.populate(GCChunkProvider.java:451)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.ChunkProviderServer.populate(ChunkProviderServer.java:218)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.Chunk.populateChunk(Chunk.java:1180)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.ChunkProviderServer.loadChunk(ChunkProviderServer.java:118)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.ChunkProviderServer.provideChunk(ChunkProviderServer.java:131)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.World.isBlockSolidOnSide(World.java:4095)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at micdoodle8.mods.galacticraft.GCBlockUnlitTorch.onBlockAdded(GCBlockUnlitTorch.java:151)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.Chunk.setBlockIDWithMetadata(Chunk.java:691)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.World.setBlockAndMetadataWithUpdate(World.java:405)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.World.setBlockAndMetadata(World.java:383)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.StructureComponent.placeBlockAtCurrentPosition(StructureComponent.java:536)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at micdoodle8.mods.galacticraft.GCComponentCreeperPitCorridor.addComponentParts(GCComponentCreeperPitCorridor.java:116)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.StructureStart.generateStructure(StructureStart.java:36)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.MapGenStructure.generateStructuresInChunk(MapGenStructure.java:51)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at micdoodle8.mods.galacticraft.GCChunkProvider.populate(GCChunkProvider.java:451)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.ChunkProviderServer.populate(ChunkProviderServer.java:218)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.Chunk.populateChunk(Chunk.java:1180)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.ChunkProviderServer.loadChunk(ChunkProviderServer.java:118)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.ChunkProviderServer.provideChunk(ChunkProviderServer.java:131)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.World.getChunkFromChunkCoords(World.java:375)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.WorldServer.getAllTileEntityInBox(WorldServer.java:568)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.EntityPlayerMP.localOnUpdate(EntityPlayerMP.java:1190)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.ServerPlayerBase.onUpdate(ServerPlayerBase.java:764)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at micdoodle8.mods.galacticraft.GCPlayerBaseServer.onUpdate(GCPlayerBaseServer.java:175)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.ServerPlayerAPI.onUpdate(ServerPlayerAPI.java:3554)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.ServerPlayerAPI.onUpdate(ServerPlayerAPI.java:3532)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.EntityPlayerMP.onUpdate(EntityPlayerMP.java:1145)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:2056)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.WorldServer.updateEntityWithOptionalForce(WorldServer.java:535)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.World.updateEntity(World.java:2021)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.World.updateEntities(World.java:1902)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.WorldServer.updateEntities(WorldServer.java:434)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:631)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:562)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:107)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:468)
2012-09-30 14:40:35 [iNFO] [sTDERR] 	at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:18)

 

 

Posted

You need to be careful when you create recursive loops:

2012-09-30 14:40:35 [iNFO] [sTDERR]  at java.util.HashMap$HashIterator.nextEntry(Unknown Source)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at java.util.HashMap$ValueIterator.next(Unknown Source)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.MapGenStructure.generateStructuresInChunk(MapGenStructure.java:47)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at micdoodle8.mods.galacticraft.GCChunkProvider.populate(GCChunkProvider.java:451)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.ChunkProviderServer.populate(ChunkProviderServer.java:218)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.Chunk.populateChunk(Chunk.java:1180)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.ChunkProviderServer.loadChunk(ChunkProviderServer.java:118)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.ChunkProviderServer.provideChunk(ChunkProviderServer.java:131)

 

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.World.isBlockSolidOnSide(World.java:4095)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at micdoodle8.mods.galacticraft.GCBlockUnlitTorch.onBlockAdded(GCBlockUnlitTorch.java:151)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.Chunk.setBlockIDWithMetadata(Chunk.java:691)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.World.setBlockAndMetadataWithUpdate(World.java:405)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.World.setBlockAndMetadata(World.java:383)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.StructureComponent.placeBlockAtCurrentPosition(StructureComponent.java:536)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at micdoodle8.mods.galacticraft.GCComponentCreeperPitCorridor.addComponentParts(GCComponentCreeperPitCorridor.java:116)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.StructureStart.generateStructure(StructureStart.java:36)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.MapGenStructure.generateStructuresInChunk(MapGenStructure.java:51)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at micdoodle8.mods.galacticraft.GCChunkProvider.populate(GCChunkProvider.java:451)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.ChunkProviderServer.populate(ChunkProviderServer.java:218)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.Chunk.populateChunk(Chunk.java:1180)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.ChunkProviderServer.loadChunk(ChunkProviderServer.java:118)

2012-09-30 14:40:35 [iNFO] [sTDERR]  at net.minecraft.src.ChunkProviderServer.provideChunk(ChunkProviderServer.java:131)

 

See the recursion?

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Okay I see it now in that one, but getting a different stack trace now...

 

java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
at java.util.HashMap$ValueIterator.next(Unknown Source)
at net.minecraft.src.MapGenStructure.generateStructuresInChunk(MapGenStructure.java:47)
at micdoodle8.mods.galacticraft.GCChunkProvider.populate(GCChunkProvider.java:451)
at net.minecraft.src.ChunkProviderServer.populate(ChunkProviderServer.java:218)
at net.minecraft.src.Chunk.populateChunk(Chunk.java:1185)
at net.minecraft.src.ChunkProviderServer.loadChunk(ChunkProviderServer.java:118)
at net.minecraft.src.PlayerInstance.<init>(PlayerInstance.java:26)
at net.minecraft.src.PlayerManager.getOrCreateChunkWatcher(PlayerManager.java:88)
at net.minecraft.src.PlayerManager.updateMountedMovingPlayer(PlayerManager.java:244)
at net.minecraft.src.ServerConfigurationManager.serverUpdateMountedMovingPlayer(ServerConfigurationManager.java:197)
at net.minecraft.src.NetServerHandler.handleFlying(NetServerHandler.java:341)
at net.minecraft.src.Packet10Flying.processPacket(Packet10Flying.java:51)
at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:78)
at net.minecraft.src.NetServerHandler.networkTick(NetServerHandler.java:76)
at net.minecraft.src.NetworkListenThread.networkTick(NetworkListenThread.java:55)
at net.minecraft.src.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:111)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:645)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:562)
at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:107)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:468)
at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:18)

Posted

Still has issues with running that code, while its already running.

Its obvious what its trying to itterate over, make sure while its itterating it it doesnt add or remove to the array.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Note: I'm not a Java programmer, I just like puzzles. :)

 

buildComponent() calls makeCorridor() 4 times.  Every call to makeCorridor() calls buildComponent().  Am I missing the way out of this loop? I suspect the list.add(var12) is causing the CME.. is something iterating over this list when the add() happens?

 

 

I'm fixing the stupid villagers.  http://www.minecraftforum.net/topic/1588460-

Posted

Note: I'm not a Java programmer, I just like puzzles. :)

 

buildComponent() calls makeCorridor() 4 times.  Every call to makeCorridor() calls buildComponent().  Am I missing the way out of this loop? I suspect the list.add(var12) is causing the CME.. is something iterating over this list when the add() happens?

 

Well makeCorridor() is calling buildComponent() in the corridor class, so it wouldn't create an infinite loop. The cme is in MapGenStructure, which is code I don't access and never edited.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.