From 6565d84cf9fd0a255cc012e0a4b83302d4354d8c Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Mon, 7 Jan 2013 01:20:36 -0800 Subject: [PATCH] Shutting down more concurrency errors. --- .../util/blockmeta/chunkmeta/HashChunkManager.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java index 90bc1b555..bd4da0f32 100755 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java @@ -336,7 +336,8 @@ public class HashChunkManager implements ChunkManager { } } - for(Entity entity : spawnedMobs) { + List tempSpawnedMobs = new ArrayList(spawnedMobs); + for(Entity entity : tempSpawnedMobs) { World entityWorld = entity.getWorld(); if(world != entityWorld) @@ -348,7 +349,8 @@ public class HashChunkManager implements ChunkManager { saveChunk(cx, cz, world); } - for(Entity entity : spawnedPets) { + List tempSpawnedPets = new ArrayList(spawnedPets); + for(Entity entity : tempSpawnedPets) { World entityWorld = entity.getWorld(); if(world != entityWorld) @@ -388,7 +390,8 @@ public class HashChunkManager implements ChunkManager { safeToRemoveMobs = false; - for(Entity entity : spawnedMobs) { + List tempSpawnedMobs = new ArrayList(spawnedMobs); + for(Entity entity : tempSpawnedMobs) { World entityWorld = entity.getWorld(); if(world != entityWorld) @@ -400,7 +403,8 @@ public class HashChunkManager implements ChunkManager { unloadChunk(cx, cz, world); } - for(Entity entity : spawnedPets) { + List tempSpawnedPets = new ArrayList(spawnedPets); + for(Entity entity : tempSpawnedPets) { World entityWorld = entity.getWorld(); if(world != entityWorld)