Permalink
Browse files

Merge pull request #410 from Glitchfinder/master

Fixing a concurrent modification error.
  • Loading branch information...
Glitchfinder committed Jan 2, 2013
2 parents 48150e2 + 5b18abb commit 4161952566f2fa404826fadfca4cda185e70f9db
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/main/java/com/gmail/nossr50/util/blockmeta/chunkmeta/HashChunkManager.java
@@ -222,7 +222,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;
@@ -232,7 +233,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 4161952

Please sign in to comment.