Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-12 22:20:08 +01:00
Made //deform round the results before lookup and fixed some potential issues.
Dieser Commit ist enthalten in:
Ursprung
2edf3559d8
Commit
187896c5ed
@ -2674,19 +2674,35 @@ public class EditSession {
|
|||||||
final RValue y = expression.getVariable("y");
|
final RValue y = expression.getVariable("y");
|
||||||
final RValue z = expression.getVariable("z");
|
final RValue z = expression.getVariable("z");
|
||||||
|
|
||||||
int affected = 0;
|
Vector zero2 = zero.add(0.5, 0.5, 0.5);
|
||||||
|
|
||||||
|
final DoubleArrayList<BlockVector, BaseBlock> queue = new DoubleArrayList<BlockVector, BaseBlock>(false);
|
||||||
|
|
||||||
for (BlockVector position : region) {
|
for (BlockVector position : region) {
|
||||||
|
// offset, scale
|
||||||
final Vector scaled = position.subtract(zero).divide(unit);
|
final Vector scaled = position.subtract(zero).divide(unit);
|
||||||
|
|
||||||
|
// transform
|
||||||
expression.evaluate(scaled.getX(), scaled.getY(), scaled.getZ());
|
expression.evaluate(scaled.getX(), scaled.getY(), scaled.getZ());
|
||||||
|
|
||||||
final Vector sourceScaled = new Vector(x.getValue(), y.getValue(), z.getValue());
|
final Vector sourceScaled = new Vector(x.getValue(), y.getValue(), z.getValue());
|
||||||
|
|
||||||
final BlockVector sourcePosition = sourceScaled.multiply(unit).add(zero).toBlockPoint();
|
// unscale, unoffset, round-nearest
|
||||||
|
final BlockVector sourcePosition = sourceScaled.multiply(unit).add(zero2).toBlockPoint();
|
||||||
|
|
||||||
|
// read block from world
|
||||||
BaseBlock material = new BaseBlock(world.getBlockType(sourcePosition), world.getBlockData(sourcePosition));
|
BaseBlock material = new BaseBlock(world.getBlockType(sourcePosition), world.getBlockData(sourcePosition));
|
||||||
|
|
||||||
|
// queue operation
|
||||||
|
queue.put(position, material);
|
||||||
|
}
|
||||||
|
|
||||||
|
int affected = 0;
|
||||||
|
for (Map.Entry<BlockVector, BaseBlock> entry : queue) {
|
||||||
|
BlockVector position = entry.getKey();
|
||||||
|
BaseBlock material = entry.getValue();
|
||||||
|
|
||||||
|
// set at new position
|
||||||
if (setBlock(position, material)) {
|
if (setBlock(position, material)) {
|
||||||
++affected;
|
++affected;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren