Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-09-07 00:22:51 +02:00
LocalBlockVectorSet shouldn't actually be used from multiple threads. SparseBitSet is not thread safe
Dieser Commit ist enthalten in:
Ursprung
6e586da83e
Commit
8c8419a1c5
@ -17,8 +17,8 @@ import java.util.Set;
|
|||||||
public class LocalBlockVectorSet implements Set<BlockVector3> {
|
public class LocalBlockVectorSet implements Set<BlockVector3> {
|
||||||
|
|
||||||
private final SparseBitSet set;
|
private final SparseBitSet set;
|
||||||
private volatile int offsetX;
|
private int offsetX;
|
||||||
private volatile int offsetZ;
|
private int offsetZ;
|
||||||
|
|
||||||
public LocalBlockVectorSet() {
|
public LocalBlockVectorSet() {
|
||||||
offsetX = offsetZ = Integer.MAX_VALUE;
|
offsetX = offsetZ = Integer.MAX_VALUE;
|
||||||
@ -211,7 +211,7 @@ public class LocalBlockVectorSet implements Set<BlockVector3> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean add(int x, int y, int z) {
|
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;
|
offsetX = x;
|
||||||
offsetZ = z;
|
offsetZ = z;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren