Class BlockTypeMask
java.lang.Object
com.sk89q.worldedit.function.mask.AbstractMask
com.sk89q.worldedit.function.mask.AbstractExtentMask
com.sk89q.worldedit.function.mask.BlockTypeMask
- All Implemented Interfaces:
Mask
A mask that checks whether blocks at the given positions are matched by
a block in a list.
This mask checks for ONLY the block type. If state should also be checked,
use BlockMask
.
-
Constructor Summary
ConstructorDescriptionBlockTypeMask
(Extent extent, BlockType... block) Create a new block mask.BlockTypeMask
(Extent extent, Collection<BlockType> blocks) Create a new block mask. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the given blocks to the list of criteria.void
add
(Collection<BlockType> blocks) Add the given blocks to the list of criteria.copy()
Returns a copy of the mask.Get the list of blocks that are tested with.boolean
boolean
test
(Extent extent, BlockVector3 vector) boolean
test
(BlockVector3 vector) Returns true if the criteria is met.boolean
toMask2D()
Get the 2D version of this mask if one exists.Methods inherited from class com.sk89q.worldedit.function.mask.AbstractExtentMask
getExtent, setExtent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sk89q.worldedit.function.mask.Mask
inverse, optimize, toFilter, toFilter, tryCombine, tryOptimize, tryOr
-
Constructor Details
-
BlockTypeMask
Create a new block mask.- Parameters:
extent
- the extentblocks
- a list of blocks to match
-
BlockTypeMask
Create a new block mask.- Parameters:
extent
- the extentblock
- an array of blocks to match
-
-
Method Details
-
add
Add the given blocks to the list of criteria.- Parameters:
blocks
- a list of blocks
-
add
Add the given blocks to the list of criteria.- Parameters:
block
- an array of blocks
-
getBlocks
Get the list of blocks that are tested with.- Returns:
- a list of blocks
-
test
Description copied from interface:Mask
Returns true if the criteria is met.- Parameters:
vector
- the vector to test- Returns:
- true if the criteria is met
-
test
- Specified by:
test
in classAbstractExtentMask
-
replacesAir
public boolean replacesAir() -
test
-
toMask2D
Description copied from interface:Mask
Get the 2D version of this mask if one exists.- Returns:
- a 2D mask version or
null
if this mask can't be 2D
-
copy
Description copied from interface:Mask
Returns a copy of the mask. Usually for multi-threaded operation- Returns:
- a clone of the mask
-