LocalBlockVectorSet shouldn't actually be used from multiple threads. SparseBitSet is not thread safe

Dieser Commit ist enthalten in:
dordsor21 2021-09-11 16:41:42 +01:00
Ursprung 6e586da83e
Commit 8c8419a1c5
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -17,8 +17,8 @@ import java.util.Set;
public class LocalBlockVectorSet implements Set<BlockVector3> {
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<BlockVector3> {
}
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;
}