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
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the given blocks to the list of criteria.add(BlockState... states) voidadd(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()booleanisEmpty()remove(BlockState... states) booleanbooleantest(BlockVector3 vector) Returns true if the criteria is met.booleantest(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, toStringMethods 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:
testin classABlockMask
-
test
Description copied from interface:MaskReturns true if the criteria is met.- Specified by:
testin interfaceMask- Overrides:
testin classABlockMask- Parameters:
vector- the vector to test- Returns:
- true if the criteria is met
-
replacesAir
public boolean replacesAir() -
tryCombine
- Specified by:
tryCombinein interfaceMask- Overrides:
tryCombinein classABlockMask
-
tryOr
- Specified by:
tryOrin interfaceMask- Overrides:
tryOrin classABlockMask
-
toMask2D
Description copied from interface:MaskGet the 2D version of this mask if one exists.- Returns:
- a 2D mask version or
nullif this mask can't be 2D
-
tryOptimize
Description copied from interface:MaskReturns null if no optimization took place otherwise a new/same mask- Returns:
-
inverse
-
copy
Description copied from interface:MaskReturns a copy of the mask. Usually for multi-threaded operation- Returns:
- a clone of the mask
-