This commit aims to fix existing issues regarding the "0/-1 blocks affected" bug. Introducing the new LinkedFilter class allows us to use multiple filters for single-filter operations, e.g. applying a pattern to blocks while also counting the amount of blocks applied to. SetFilter.java was also removed due to not being used.
This commit is contained in:
IronApollo
2020-05-07 12:29:18 -04:00
parent afba834b83
commit 8b1a0bbc34
6 changed files with 93 additions and 39 deletions

View File

@ -1069,6 +1069,31 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
return this.changes;
}
@Override
public <B extends BlockStateHolder<B>> int setBlocks(Region region, B block) throws MaxChangedBlocksException {
return this.changes = super.setBlocks(region, block);
}
@Override
public int setBlocks(Region region, Pattern pattern) throws MaxChangedBlocksException {
return this.changes = super.setBlocks(region, pattern);
}
@Override
public <B extends BlockStateHolder<B>> int replaceBlocks(Region region, Set<BaseBlock> filter, B replacement) throws MaxChangedBlocksException {
return this.changes = super.replaceBlocks(region, filter, replacement);
}
@Override
public int replaceBlocks(Region region, Set<BaseBlock> filter, Pattern pattern) throws MaxChangedBlocksException {
return this.changes = super.replaceBlocks(region, filter, pattern);
}
@Override
public int replaceBlocks(Region region, Mask mask, Pattern pattern) throws MaxChangedBlocksException {
return this.changes = super.replaceBlocks(region, mask, pattern);
}
/**
* Fills an area recursively in the X/Z directions.
*