From 84d7da32747882570ddf77ed846688f3c17deb03 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 13 Dec 2016 15:00:36 +1100 Subject: [PATCH] properly reset editsession limit --- core/src/main/java/com/sk89q/worldedit/EditSession.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/sk89q/worldedit/EditSession.java b/core/src/main/java/com/sk89q/worldedit/EditSession.java index 3f2f6bbb..64557da8 100644 --- a/core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -361,7 +361,11 @@ public class EditSession extends AbstractWorld implements HasFaweQueue { } public void resetLimit() { - this.limit = this.originalLimit.copy(); + this.limit.set(this.originalLimit); + ExtentTraverser find = new ExtentTraverser(extent).find(ProcessedWEExtent.class); + if (find != null && find.get() != null) { + find.get().setLimit(this.limit); + } } /** @@ -1236,7 +1240,7 @@ public class EditSession extends AbstractWorld implements HasFaweQueue { // Reset limit limit.set(originalLimit); // Enqueue it - if (queue == null || queue.size() == 0) { + if (queue == null || queue.isEmpty()) { queue.dequeue(); return; } @@ -1251,7 +1255,6 @@ public class EditSession extends AbstractWorld implements HasFaweQueue { } else { ((FaweChangeSet) getChangeSet()).flush(); } - } }