This commit is contained in:
Jesse Boyd
2019-07-30 07:39:18 +10:00
parent 02d5f3e8d5
commit 7967ef4db4
25 changed files with 74 additions and 90 deletions

View File

@ -50,7 +50,7 @@ public class BlockReplace implements RegionFunction {
@Override
public boolean apply(BlockVector3 position) throws WorldEditException {
return extent.setBlock(position, pattern.apply(position));
return pattern.apply(extent, position, position);
}
}

View File

@ -40,7 +40,7 @@ public class ExistingBlockMask extends AbstractExtentMask {
@Override
public boolean test(BlockVector3 vector) {
return !getExtent().getBlock(vector).getBlockType().getMaterial().isAir();
return !vector.getBlock(getExtent()).getMaterial().isAir();
}
@Nullable

View File

@ -31,13 +31,6 @@ public class SolidBlockMask extends BlockMask {
add(state -> state.getMaterial().isMovementBlocker());
}
@Override
public boolean test(BlockVector3 vector) {
Extent extent = getExtent();
BlockState block = extent.getBlock(vector);
return block.getBlockType().getMaterial().isMovementBlocker();
}
@Nullable
@Override
public Mask2D toMask2D() {

View File

@ -66,11 +66,13 @@ public class ChangeSetExecutor implements Operation {
@Override
public Operation resume(RunContext run) throws WorldEditException {
while (iterator.hasNext()) {
Change change = iterator.next();
Change change = iterator.next();
if (type == Type.UNDO) {
while (iterator.hasNext()) {
change.undo(context);
}
} else {
while (iterator.hasNext()) {
change.redo(context);
}
}