mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 23:04:08 +00:00
ActionQueue.stopWhenEmpty
This commit is contained in:
1 parent
b37f9a7ea4
commit
70f0ab1e6f
1 file changed
+17
@@ -19,6 +19,8 @@ public class ActionQueue implements IActionQueue {
|
||||
protected boolean isParallel;
|
||||
|
||||
protected boolean isDead;
|
||||
protected boolean stopWhenEmpty;
|
||||
|
||||
protected boolean killWhenEmpty;
|
||||
protected int killWhenEmptyAfter = 100;
|
||||
|
||||
@@ -70,6 +72,18 @@ public class ActionQueue implements IActionQueue {
|
||||
isParallel = parallel;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStoppedWhenEmpty() {
|
||||
return stopWhenEmpty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IActionQueue stopWhenEmpty(boolean stopWhenEmpty) {
|
||||
this.stopWhenEmpty = stopWhenEmpty;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isKilledWhenEmpty() {
|
||||
return killWhenEmpty;
|
||||
@@ -309,6 +323,9 @@ public class ActionQueue implements IActionQueue {
|
||||
pit.remove();
|
||||
}
|
||||
|
||||
if (stopWhenEmpty && !hasActiveTasks())
|
||||
stop();
|
||||
|
||||
killWhenEmpty();
|
||||
|
||||
if (manager.debug && active)
|
||||
|
||||
Reference in new issue
Block a user