Improve mask api (#1793)

* Improve mask api

* Revert javadocs change
This commit is contained in:
BloodEko 2021-06-22 00:07:59 +02:00 committed by GitHub
parent b8a9c0070c
commit 183ae4a140
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 4 additions and 55 deletions

View File

@ -96,10 +96,4 @@ public boolean test(BlockVector3 vector) {
return biomes.contains(biome);
}
@Nullable
@Override
public Mask2D toMask2D() {
return null;
}
}

View File

@ -44,10 +44,4 @@ public BlockCategoryMask(Extent extent, BlockCategory category) {
public boolean test(BlockVector3 vector) {
return category.contains(getExtent().getBlock(vector));
}
@Nullable
@Override
public Mask2D toMask2D() {
return null;
}
}

View File

@ -105,10 +105,4 @@ public boolean test(BlockVector3 vector) {
return false;
}
@Nullable
@Override
public Mask2D toMask2D() {
return null;
}
}

View File

@ -61,10 +61,4 @@ public boolean test(BlockVector3 vector) {
return checkProps.entrySet().stream()
.allMatch(entry -> block.getState(entry.getKey()) == entry.getValue());
}
@Nullable
@Override
public Mask2D toMask2D() {
return null;
}
}

View File

@ -96,10 +96,4 @@ public Collection<BlockType> getBlocks() {
public boolean test(BlockVector3 vector) {
return blocks.contains(getExtent().getBlock(vector).getBlockType());
}
@Nullable
@Override
public Mask2D toMask2D() {
return null;
}
}

View File

@ -51,10 +51,4 @@ public boolean test(BlockVector3 vector) {
return vector.getY() >= minY && vector.getY() <= maxY;
}
@Nullable
@Override
public Mask2D toMask2D() {
return null;
}
}

View File

@ -44,10 +44,4 @@ public boolean test(BlockVector3 vector) {
return !getExtent().getBlock(vector).getBlockType().getMaterial().isAir();
}
@Nullable
@Override
public Mask2D toMask2D() {
return null;
}
}

View File

@ -26,6 +26,7 @@
/**
* Tests whether a given vector meets a criteria.
*/
@FunctionalInterface
public interface Mask {
/**
@ -42,6 +43,8 @@ public interface Mask {
* @return a 2D mask version or {@code null} if this mask can't be 2D
*/
@Nullable
Mask2D toMask2D();
default Mask2D toMask2D() {
return null;
}
}

View File

@ -66,10 +66,4 @@ public boolean test(BlockVector3 vector) {
return region.contains(vector);
}
@Nullable
@Override
public Mask2D toMask2D() {
return null;
}
}

View File

@ -38,10 +38,4 @@ public boolean test(BlockVector3 vector) {
return block.getBlockType().getMaterial().isMovementBlocker();
}
@Nullable
@Override
public Mask2D toMask2D() {
return null;
}
}