Fix queryRel for //deform and //brush deform

This commit is contained in:
TomyLobo 2024-07-19 02:21:37 +02:00
parent 292dae65cb
commit 570ec87790

View File

@ -2440,9 +2440,12 @@ public int deformRegion(final Region region, final Vector3 zero, final Vector3 u
final DoubleArrayList<BlockVector3, BaseBlock> 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;