Permalink
Browse files

Fixing a concurrent modification error.

  • Loading branch information...
1 parent 707a388 commit 5b18abbea01676a4a416eb171bf8e757dc6a622f @Glitchfinder Glitchfinder committed Jan 2, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java
@@ -223,7 +223,8 @@ public synchronized void saveChunk(int cx, int cz, World world) {
boolean unloaded = false;
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))
continue;
@@ -233,7 +234,8 @@ public synchronized void saveChunk(int cx, int cz, World world) {
}
if(!unloaded) {
- for(Entity entity : spawnedPets) {
+ List<Entity> tempSpawnedPets = new ArrayList<Entity>(spawnedPets);
+ for(Entity entity : tempSpawnedPets) {
if(!isEntityInChunk(entity, cx, cz, world))
continue;

0 comments on commit 5b18abb

Please sign in to comment.