Class BlockMask
java.lang.Object
com.sk89q.worldedit.function.mask.AbstractMask
com.sk89q.worldedit.function.mask.AbstractExtentMask
com.fastasyncworldedit.core.function.mask.ABlockMask
com.sk89q.worldedit.function.mask.BlockMask
- All Implemented Interfaces:
Mask
- Direct Known Subclasses:
AirMask
,LiquidMask
,SolidBlockMask
A mask that checks whether blocks at the given positions are matched by
a block in a list.
This mask checks for both an exact block type and state value match, respecting fuzzy status of the BlockState.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the given blocks to the list of criteria.add
(BlockState... states) void
add
(Collection<BaseBlock> blocks) Deprecated.NBT not supported by this maskadd
(Predicate<BlockState> predicate) clear()
copy()
Returns a copy of the mask.Get the list of blocks that are tested with.inverse()
boolean
isEmpty()
remove
(BlockState... states) boolean
boolean
test
(BlockVector3 vector) Returns true if the criteria is met.boolean
test
(BlockState state) toMask2D()
Get the 2D version of this mask if one exists.tryCombine
(Mask mask) Returns null if no optimization took place otherwise a new/same maskMethods inherited from class com.fastasyncworldedit.core.function.mask.ABlockMask
test, toString
Methods inherited from class com.sk89q.worldedit.function.mask.AbstractExtentMask
getExtent, setExtent
-
Constructor Details
-
BlockMask
public BlockMask() -
BlockMask
-
BlockMask
-
BlockMask
Deprecated.NBT not supported by this maskCreate a new block mask.- Parameters:
extent
- the extentblocks
- a list of blocks to match
-
BlockMask
Create a new block mask.- Parameters:
extent
- the extentblock
- an array of blocks to match
-
-
Method Details
-
add
-
add
-
remove
-
clear
-
isEmpty
public boolean isEmpty() -
add
-
add
Deprecated.NBT not supported by this maskAdd 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
- Specified by:
test
in classABlockMask
-
test
Description copied from interface:Mask
Returns true if the criteria is met.- Specified by:
test
in interfaceMask
- Overrides:
test
in classABlockMask
- Parameters:
vector
- the vector to test- Returns:
- true if the criteria is met
-
replacesAir
public boolean replacesAir() -
tryCombine
- Specified by:
tryCombine
in interfaceMask
- Overrides:
tryCombine
in classABlockMask
-
tryOr
- Specified by:
tryOr
in interfaceMask
- Overrides:
tryOr
in classABlockMask
-
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
-
tryOptimize
Description copied from interface:Mask
Returns null if no optimization took place otherwise a new/same mask- Returns:
-
inverse
-
copy
Description copied from interface:Mask
Returns a copy of the mask. Usually for multi-threaded operation- Returns:
- a clone of the mask
-