From bcb9320a458c6539b92c893ff8fd21aa7834a712 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 15 Jan 2018 23:21:11 +1100 Subject: [PATCH] Discard unused EditSession when using /u --- favs/src/main/java/com/thevoxelbox/voxelsniper/Sniper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/favs/src/main/java/com/thevoxelbox/voxelsniper/Sniper.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/Sniper.java index 64206024..8007f29c 100644 --- a/favs/src/main/java/com/thevoxelbox/voxelsniper/Sniper.java +++ b/favs/src/main/java/com/thevoxelbox/voxelsniper/Sniper.java @@ -25,6 +25,7 @@ import com.google.common.collect.ClassToInstanceMap; import com.google.common.collect.HashBiMap; import com.google.common.collect.ImmutableBiMap; import com.google.common.collect.MutableClassToInstanceMap; +import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extent.MaskingExtent; import com.sk89q.worldedit.function.mask.Mask; @@ -465,8 +466,11 @@ public class Sniper { public void run() { int count = 0; for (int i = 0; i < amount; i++) { - if (fp.getSession().undo(null, fp.getPlayer()) == null) { + EditSession es = fp.getSession().undo(null, fp.getPlayer()); + if (es == null) { break; + } else { + es.flushQueue(); } count++; }