Skip to content

Commit

Permalink
Fixing a concurrent modification error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glitchfinder committed Jan 2, 2013
1 parent 707a388 commit 5b18abb
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -223,7 +223,8 @@ public synchronized void saveChunk(int cx, int cz, World world) {


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;


Expand All @@ -233,7 +234,8 @@ public synchronized void saveChunk(int cx, int cz, World world) {
} }


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;


Expand Down

0 comments on commit 5b18abb

Please sign in to comment.