diff --git a/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java b/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java index ffa77ff..f57d398 100644 --- a/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java +++ b/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java @@ -212,6 +212,7 @@ { AnvilChunkLoader.PendingChunk pendingchunk = null; Object object = this.syncLockObject; + int key; synchronized (this.syncLockObject) { @@ -223,7 +224,7 @@ TIntObjectIterator it = pendingSaves.iterator(); it.advance(); pendingchunk = it.value(); - it.remove(); + key = it.key(); } if (pendingchunk != null) @@ -236,6 +237,11 @@ { exception.printStackTrace(); } + + synchronized (this.syncLockObject) + { + pendingSaves.remove(key); + } } return true;