mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 20:36:42 +00:00
Fix #647
This commit is contained in:
@ -15,6 +15,10 @@ public abstract class ABlockMask extends AbstractExtentMask {
|
||||
super(extent);
|
||||
}
|
||||
|
||||
@Override public boolean test(Extent extent, BlockVector3 vector) {
|
||||
return test(extent.getBlock(vector));
|
||||
}
|
||||
|
||||
@Override public boolean test(BlockVector3 vector) {
|
||||
return test(getExtent().getBlock(vector));
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
@ -59,4 +60,6 @@ public abstract class AbstractExtentMask extends AbstractMask {
|
||||
this.extent = extent;
|
||||
}
|
||||
|
||||
abstract public boolean test(Extent extent, BlockVector3 position);
|
||||
|
||||
}
|
||||
|
@ -46,6 +46,11 @@ public class BlockCategoryMask extends AbstractExtentMask {
|
||||
return category.contains(getExtent().getBlock(vector));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(Extent extent, BlockVector3 vector) {
|
||||
return category.contains(extent.getBlock(vector));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Mask2D toMask2D() {
|
||||
|
@ -57,6 +57,11 @@ public class BlockStateMask extends AbstractExtentMask {
|
||||
return test(getExtent().getBlock(vector));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(Extent extent, BlockVector3 vector) {
|
||||
return test(extent.getBlock(vector));
|
||||
}
|
||||
|
||||
public boolean test(BlockState block) {
|
||||
final Map<Property<Object>, Object> checkProps = cache
|
||||
.computeIfAbsent(block.getBlockType(), (b -> Blocks.resolveProperties(states, b)));
|
||||
|
@ -114,6 +114,11 @@ public class BlockTypeMask extends AbstractExtentMask {
|
||||
return test(getExtent().getBlock(vector).getBlockType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(Extent extent, BlockVector3 vector) {
|
||||
return test(extent.getBlock(vector).getBlockType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replacesAir() {
|
||||
return hasAir;
|
||||
|
@ -1,11 +0,0 @@
|
||||
package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import com.boydti.fawe.object.function.mask.AbstractDelegateMask;
|
||||
|
||||
public class DelegateExtentMask extends AbstractDelegateMask {
|
||||
|
||||
public DelegateExtentMask(Mask parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
}
|
@ -44,6 +44,11 @@ public class ExistingBlockMask extends AbstractExtentMask {
|
||||
return !getExtent().getBlock(vector).getBlockType().getMaterial().isAir();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(Extent extent, BlockVector3 vector) {
|
||||
return !extent.getBlock(vector).getBlockType().getMaterial().isAir();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Mask2D toMask2D() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
Reference in New Issue
Block a user