From e0c8776f0fd353368312253284d78a71a08c6384 Mon Sep 17 00:00:00 2001 From: wizjany Date: Tue, 28 Jun 2016 23:59:06 -0400 Subject: [PATCH] Fix query function in expression masks. Fixes WORLDEDIT-3344. --- .../com/sk89q/worldedit/function/mask/ExpressionMask.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java index ef0a02d01..d1d1e374b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.internal.expression.runtime.EvaluationException; +import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment; import javax.annotation.Nullable; @@ -62,6 +63,9 @@ public class ExpressionMask extends AbstractMask { @Override public boolean test(Vector vector) { try { + if (expression.getEnvironment() instanceof WorldEditExpressionEnvironment) { + ((WorldEditExpressionEnvironment) expression.getEnvironment()).setCurrentBlock(vector); + } return expression.evaluate(vector.getX(), vector.getY(), vector.getZ()) > 0; } catch (EvaluationException e) { return false;