Add tracing for unflushed EditSessions

This commit is contained in:
Kenzie Togami
2018-10-30 18:39:51 -07:00
parent 93de97dc19
commit e1fbaaff59
11 changed files with 81 additions and 3 deletions

View File

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

View File

@ -94,6 +94,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(Vector location, BlockStateHolder block) throws WorldEditException {
BlockState existing = getBlock(location);