mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +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
|
||||
public Mask inverse() {
|
||||
for (int i = 0; i < bitSets.length; i++) {
|
||||
if (bitSets[i] == null) bitSets[i] = ALL;
|
||||
else if (bitSets[i] == ALL) bitSets[i] = null;
|
||||
long[][] cloned = bitSets.clone();
|
||||
for (int i = 0; i < cloned.length; i++) {
|
||||
if (cloned[i] == null) cloned[i] = ALL;
|
||||
else if (cloned[i] == ALL) cloned[i] = null;
|
||||
else {
|
||||
for (int j = 0; j < bitSets[i].length; j++)
|
||||
bitSets[i][j] = ~bitSets[i][j];
|
||||
for (int j = 0; j < cloned[i].length; j++)
|
||||
cloned[i][j] = ~cloned[i][j];
|
||||
}
|
||||
}
|
||||
return this;
|
||||
return new BlockMask(getExtent(), cloned);
|
||||
}
|
||||
|
||||
public boolean test(BlockState block) {
|
||||
|
@ -62,7 +62,7 @@ public class MaskIntersection extends AbstractMask {
|
||||
if (masks.isEmpty()) {
|
||||
masksArray = new Mask[]{Masks.alwaysFalse()};
|
||||
} 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;
|
||||
}
|
||||
|
||||
for (Mask mask : masks) {
|
||||
for (Mask mask : masksArray) {
|
||||
if (!mask.test(vector)) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user