Merge pull request #435 from sk89q/feature/trace-unflushed-sessions

Add tracing for unflushed EditSessions
This commit is contained in:
Matthew Miller
2018-11-04 17:21:25 +10:00
committed by GitHub
11 changed files with 80 additions and 4 deletions

View File

@ -72,6 +72,10 @@ public class ChunkBatchingExtent extends AbstractDelegateExtent {
this.enabled = enabled;
}
public boolean commitRequired() {
return batches.size() > 0;
}
@Override
public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws WorldEditException {
if (!enabled) {

View File

@ -93,6 +93,10 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder
this.enabled = enabled;
}
public boolean commitRequired() {
return stage1.size() > 0 || stage2.size() > 0 || stage3.size() > 0;
}
@Override
public boolean setBlock(BlockVector3 location, BlockStateHolder block) throws WorldEditException {
BlockState existing = getBlock(location);