public class BlockTypeMask extends AbstractExtentMask
This mask checks for ONLY the block type. If state should also be checked,
use BlockMask
.
Constructor and Description |
---|
BlockTypeMask(Extent extent,
BlockType... block)
Create a new block mask.
|
BlockTypeMask(Extent extent,
java.util.Collection<BlockType> blocks)
Create a new block mask.
|
Modifier and Type | Method and Description |
---|---|
void |
add(BlockType... block)
Add the given blocks to the list of criteria.
|
void |
add(java.util.Collection<BlockType> blocks)
Add the given blocks to the list of criteria.
|
java.util.Collection<BlockType> |
getBlocks()
Get the list of blocks that are tested with.
|
boolean |
test(BlockVector3 vector)
Returns true if the criteria is met.
|
Mask2D |
toMask2D()
Get the 2D version of this mask if one exists.
|
getExtent, setExtent
public BlockTypeMask(Extent extent, java.util.Collection<BlockType> blocks)
extent
- the extentblocks
- a list of blocks to matchpublic void add(java.util.Collection<BlockType> blocks)
blocks
- a list of blockspublic void add(BlockType... block)
block
- an array of blockspublic java.util.Collection<BlockType> getBlocks()
public boolean test(BlockVector3 vector)
Mask
vector
- the vector to test