Class OffsetsMask
java.lang.Object
com.sk89q.worldedit.function.mask.AbstractMask
com.sk89q.worldedit.function.mask.OffsetsMask
- All Implemented Interfaces:
Mask
Checks whether any face of the given offsets to a block match a given mask.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OffsetsMask.Builder
Create a new builder, using the given mask.boolean
Get the flag determining if matching the current block should fail the mask.getMask()
Get the mask.int
Gets the maximum number of matches to pass.int
Gets the minimum number of matches to pass.com.google.common.collect.ImmutableSet<BlockVector3>
Get the offsets.static OffsetsMask
single
(Mask mask, BlockVector3 offset) Create an offsets mask for a single offset.boolean
test
(BlockVector3 vector) Returns true if the criteria is met.toMask2D()
Get the 2D version of this mask if one exists.
-
Method Details
-
single
Create an offsets mask for a single offset.- Parameters:
mask
- the mask to useoffset
- the offset- Returns:
- the new offsets mask
-
builder
Create a new builder, using the given mask.- Parameters:
mask
- the mask to use- Returns:
- the builder
-
getMask
Get the mask.- Returns:
- the mask
-
getExcludeSelf
public boolean getExcludeSelf()Get the flag determining if matching the current block should fail the mask.- Returns:
- if it should exclude self-matches
-
getMinMatches
public int getMinMatches()Gets the minimum number of matches to pass.- Returns:
- the minimum number of matches
-
getMaxMatches
public int getMaxMatches()Gets the maximum number of matches to pass.- Returns:
- the maximum number of matches
-
getOffsets
Get the offsets.- Returns:
- the offsets
-
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
-
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
-