From 570ec87790f8d153bf1bf0aaa475dca5c5058e8b Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Fri, 19 Jul 2024 02:21:37 +0200 Subject: [PATCH] Fix queryRel for //deform and //brush deform --- .../src/main/java/com/sk89q/worldedit/EditSession.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index f39025cef4..6ec06f36a1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -2440,9 +2440,12 @@ public int deformRegion(final Region region, final Vector3 zero, final Vector3 u final DoubleArrayList queue = new DoubleArrayList<>(false); - for (BlockVector3 position : region) { + for (BlockVector3 targetBlockPosition : region) { + final Vector3 targetPosition = targetBlockPosition.toVector3(); + environment.setCurrentBlock(targetPosition); + // offset, scale - final Vector3 scaled = position.toVector3().subtract(zero).divide(unit); + final Vector3 scaled = targetPosition.subtract(zero).divide(unit); // transform expression.evaluate(new double[]{ scaled.x(), scaled.y(), scaled.z() }, timeout); @@ -2453,7 +2456,7 @@ public int deformRegion(final Region region, final Vector3 zero, final Vector3 u final BaseBlock material = world.getFullBlock(sourcePosition); // queue operation - queue.put(position, material); + queue.put(targetBlockPosition, material); } int affected = 0;