mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix query function in expression masks.
Fixes WORLDEDIT-3344.
This commit is contained in:
parent
6e36b5236c
commit
e0c8776f0f
@ -23,6 +23,7 @@ import com.sk89q.worldedit.Vector;
|
|||||||
import com.sk89q.worldedit.internal.expression.Expression;
|
import com.sk89q.worldedit.internal.expression.Expression;
|
||||||
import com.sk89q.worldedit.internal.expression.ExpressionException;
|
import com.sk89q.worldedit.internal.expression.ExpressionException;
|
||||||
import com.sk89q.worldedit.internal.expression.runtime.EvaluationException;
|
import com.sk89q.worldedit.internal.expression.runtime.EvaluationException;
|
||||||
|
import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
@ -62,6 +63,9 @@ public class ExpressionMask extends AbstractMask {
|
|||||||
@Override
|
@Override
|
||||||
public boolean test(Vector vector) {
|
public boolean test(Vector vector) {
|
||||||
try {
|
try {
|
||||||
|
if (expression.getEnvironment() instanceof WorldEditExpressionEnvironment) {
|
||||||
|
((WorldEditExpressionEnvironment) expression.getEnvironment()).setCurrentBlock(vector);
|
||||||
|
}
|
||||||
return expression.evaluate(vector.getX(), vector.getY(), vector.getZ()) > 0;
|
return expression.evaluate(vector.getX(), vector.getY(), vector.getZ()) > 0;
|
||||||
} catch (EvaluationException e) {
|
} catch (EvaluationException e) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user