From 8c8419a1c5d9131f011f3857e020bc7038209bd9 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sat, 11 Sep 2021 16:41:42 +0100 Subject: [PATCH] LocalBlockVectorSet shouldn't actually be used from multiple threads. SparseBitSet is not thread safe --- .../fastasyncworldedit/core/math/LocalBlockVectorSet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/LocalBlockVectorSet.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/LocalBlockVectorSet.java index 23759c03b..3e7ecdd16 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/LocalBlockVectorSet.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/LocalBlockVectorSet.java @@ -17,8 +17,8 @@ import java.util.Set; public class LocalBlockVectorSet implements Set { private final SparseBitSet set; - private volatile int offsetX; - private volatile int offsetZ; + private int offsetX; + private int offsetZ; public LocalBlockVectorSet() { offsetX = offsetZ = Integer.MAX_VALUE; @@ -211,7 +211,7 @@ public class LocalBlockVectorSet implements Set { } public boolean add(int x, int y, int z) { - if (offsetX == Integer.MAX_VALUE || offsetZ == Integer.MAX_VALUE) { + if (offsetX == Integer.MAX_VALUE) { offsetX = x; offsetZ = z; }