Discard unused EditSession when using /u
This commit is contained in:
parent
2448b2fe22
commit
bcb9320a45
@ -25,6 +25,7 @@ import com.google.common.collect.ClassToInstanceMap;
|
|||||||
import com.google.common.collect.HashBiMap;
|
import com.google.common.collect.HashBiMap;
|
||||||
import com.google.common.collect.ImmutableBiMap;
|
import com.google.common.collect.ImmutableBiMap;
|
||||||
import com.google.common.collect.MutableClassToInstanceMap;
|
import com.google.common.collect.MutableClassToInstanceMap;
|
||||||
|
import com.sk89q.worldedit.EditSession;
|
||||||
import com.sk89q.worldedit.LocalSession;
|
import com.sk89q.worldedit.LocalSession;
|
||||||
import com.sk89q.worldedit.extent.MaskingExtent;
|
import com.sk89q.worldedit.extent.MaskingExtent;
|
||||||
import com.sk89q.worldedit.function.mask.Mask;
|
import com.sk89q.worldedit.function.mask.Mask;
|
||||||
@ -465,8 +466,11 @@ public class Sniper {
|
|||||||
public void run() {
|
public void run() {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (int i = 0; i < amount; i++) {
|
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;
|
break;
|
||||||
|
} else {
|
||||||
|
es.flushQueue();
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user