public class ExpressionMask extends AbstractMask
Expressions are evaluated as true
if they return a value
greater than 0
.
Constructor and Description |
---|
ExpressionMask(Expression expression)
Create a new instance.
|
ExpressionMask(Expression expression,
java.util.function.IntSupplier timeout) |
ExpressionMask(java.lang.String expression)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
test(BlockVector3 vector)
Returns true if the criteria is met.
|
Mask2D |
toMask2D()
Get the 2D version of this mask if one exists.
|
public ExpressionMask(java.lang.String expression) throws ExpressionException
expression
- the expressionExpressionException
- thrown if there is an error with the expressionpublic ExpressionMask(Expression expression)
expression
- the expressionpublic ExpressionMask(Expression expression, @Nullable java.util.function.IntSupplier timeout)
public boolean test(BlockVector3 vector)
Mask
vector
- the vector to test