mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 21:56:33 +01:00
Have cancel clear queued actions
This commit is contained in:
parent
67b918b048
commit
77be0a3794
@ -24,6 +24,7 @@ public class Cancel extends FaweCommand {
|
|||||||
UUID uuid = player.getUUID();
|
UUID uuid = player.getUUID();
|
||||||
Collection<FaweQueue> queues = SetQueue.IMP.getAllQueues();
|
Collection<FaweQueue> queues = SetQueue.IMP.getAllQueues();
|
||||||
int cancelled = 0;
|
int cancelled = 0;
|
||||||
|
player.clearActions();
|
||||||
for (FaweQueue queue : queues) {
|
for (FaweQueue queue : queues) {
|
||||||
Set<EditSession> sessions = queue.getEditSessions();
|
Set<EditSession> sessions = queue.getEditSessions();
|
||||||
for (EditSession session : sessions) {
|
for (EditSession session : sessions) {
|
||||||
|
@ -145,6 +145,12 @@ public abstract class FawePlayer<T> extends Metadatable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearActions() {
|
||||||
|
while (getActions().poll() != null) {
|
||||||
|
runningCount.decrementAndGet();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private ConcurrentLinkedDeque<Runnable> getActions() {
|
private ConcurrentLinkedDeque<Runnable> getActions() {
|
||||||
ConcurrentLinkedDeque<Runnable> adder = getMeta("fawe_action_v2");
|
ConcurrentLinkedDeque<Runnable> adder = getMeta("fawe_action_v2");
|
||||||
if (adder == null) {
|
if (adder == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user