Merge pull request #410 from Glitchfinder/master

Fixing a concurrent modification error.
This commit is contained in:
Glitchfinder 2013-01-01 19:26:39 -08:00
commit 4161952566

View File

@ -222,7 +222,8 @@ public class HashChunkManager implements ChunkManager {
boolean unloaded = false; boolean unloaded = false;
if(!store.containsKey(world.getName() + "," + cx + "," + cz)) { if(!store.containsKey(world.getName() + "," + cx + "," + cz)) {
for(Entity entity : spawnedMobs) { List<Entity> tempSpawnedMobs = new ArrayList<Entity>(spawnedMobs);
for(Entity entity : tempSpawnedMobs) {
if(!isEntityInChunk(entity, cx, cz, world)) if(!isEntityInChunk(entity, cx, cz, world))
continue; continue;
@ -232,7 +233,8 @@ public class HashChunkManager implements ChunkManager {
} }
if(!unloaded) { if(!unloaded) {
for(Entity entity : spawnedPets) { List<Entity> tempSpawnedPets = new ArrayList<Entity>(spawnedPets);
for(Entity entity : tempSpawnedPets) {
if(!isEntityInChunk(entity, cx, cz, world)) if(!isEntityInChunk(entity, cx, cz, world))
continue; continue;