geforkt von Mirrors/FastAsyncWorldEdit
Fix query function in expression masks.
Fixes WORLDEDIT-3344.
Dieser Commit ist enthalten in:
Ursprung
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.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;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren