mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
fix block mask inverse
This commit is contained in:
parent
2e1b7676eb
commit
21be61f03a
@ -212,15 +212,16 @@ public class BlockMask extends AbstractExtentMask {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mask inverse() {
|
public Mask inverse() {
|
||||||
for (int i = 0; i < bitSets.length; i++) {
|
long[][] cloned = bitSets.clone();
|
||||||
if (bitSets[i] == null) bitSets[i] = ALL;
|
for (int i = 0; i < cloned.length; i++) {
|
||||||
else if (bitSets[i] == ALL) bitSets[i] = null;
|
if (cloned[i] == null) cloned[i] = ALL;
|
||||||
|
else if (cloned[i] == ALL) cloned[i] = null;
|
||||||
else {
|
else {
|
||||||
for (int j = 0; j < bitSets[i].length; j++)
|
for (int j = 0; j < cloned[i].length; j++)
|
||||||
bitSets[i][j] = ~bitSets[i][j];
|
cloned[i][j] = ~cloned[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this;
|
return new BlockMask(getExtent(), cloned);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean test(BlockState block) {
|
public boolean test(BlockState block) {
|
||||||
|
@ -62,7 +62,7 @@ public class MaskIntersection extends AbstractMask {
|
|||||||
if (masks.isEmpty()) {
|
if (masks.isEmpty()) {
|
||||||
masksArray = new Mask[]{Masks.alwaysFalse()};
|
masksArray = new Mask[]{Masks.alwaysFalse()};
|
||||||
} else {
|
} else {
|
||||||
masksArray = masks.toArray(new Mask[masks.size()]);
|
masksArray = masks.toArray(new Mask[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ public class MaskIntersection extends AbstractMask {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Mask mask : masks) {
|
for (Mask mask : masksArray) {
|
||||||
if (!mask.test(vector)) {
|
if (!mask.test(vector)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user