Permalink
Browse files

Ensure we flush iff it is needed

  • Loading branch information...
kenzierocks committed Oct 21, 2018
1 parent a3f1c71 commit d1312c66e1d3556cef039e5895e959842f733c0a
Showing with 9 additions and 3 deletions.
  1. +9 −3 worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java
@@ -415,7 +415,7 @@ public void setBatchingChunks(boolean batchingChunks) {
}
return;
}
if (!batchingChunks) {
if (!batchingChunks && isBatchingChunks()) {
flushSession();
}
chunkBatchingExtent.setEnabled(batchingChunks);
@@ -428,9 +428,15 @@ public void setBatchingChunks(boolean batchingChunks) {
* @see #setBatchingChunks(boolean)
*/
public void disableBuffering() {
// We optimize here to avoid double calls to flushSession.
// We optimize here to avoid repeated calls to flushSession.
boolean needsFlush = isQueueEnabled() || isBatchingChunks();
if (needsFlush) {
flushSession();
}
reorderExtent.setEnabled(false);
setBatchingChunks(false);
if (chunkBatchingExtent != null) {
chunkBatchingExtent.setEnabled(false);
}
}
/**

0 comments on commit d1312c6

Please sign in to comment.