diff --git a/forge1710/src/main/java/com/boydti/fawe/forge/v1710/ForgeChunk_All.java b/forge1710/src/main/java/com/boydti/fawe/forge/v1710/ForgeChunk_All.java index 6ac81892..58d9e8da 100644 --- a/forge1710/src/main/java/com/boydti/fawe/forge/v1710/ForgeChunk_All.java +++ b/forge1710/src/main/java/com/boydti/fawe/forge/v1710/ForgeChunk_All.java @@ -182,7 +182,9 @@ public class ForgeChunk_All extends CharFaweChunk { int y = MathMan.roundInt(entity.posY); if (y < 0 || y > 255) continue; if (array[FaweCache.CACHE_J[y][z][x]] != 0) { - nmsWorld.removeEntity(entity); + synchronized (ForgeQueue_All.class) { + nmsWorld.removeEntity(entity); + } } } } @@ -193,7 +195,9 @@ public class ForgeChunk_All extends CharFaweChunk { Collection ents = new ArrayList<>(entities[i]); for (Entity entity : ents) { if (entsToRemove.contains(entity.getUniqueID())) { - nmsWorld.removeEntity(entity); + synchronized (ForgeQueue_All.class) { + nmsWorld.removeEntity(entity); + } } } } @@ -223,7 +227,9 @@ public class ForgeChunk_All extends CharFaweChunk { tag.removeTag("UUIDLeast"); entity.readFromNBT(tag); entity.setPositionAndRotation(x, y, z, yaw, pitch); - nmsWorld.spawnEntityInWorld(entity); + synchronized (ForgeQueue_All.class) { + nmsWorld.spawnEntityInWorld(entity); + } } } // Run change task if applicable @@ -247,8 +253,10 @@ public class ForgeChunk_All extends CharFaweChunk { } int k = FaweCache.CACHE_J[ly][lz][lx]; if (array[k] != 0) { - tile.getValue().invalidate();; - iterator.remove(); + synchronized (ForgeQueue_All.class) { + tile.getValue().invalidate(); + iterator.remove(); + } } } // Efficiently merge sections