mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 12:39:05 +00:00
Revamped before() and after() chaining of unscheduled IActions
This commit is contained in:
1 parent
f100fb0ab1
commit
253bfd7e17
3 files changed
+87
-68
No files matched your search
@@ -116,14 +116,13 @@ public class ActionQueue implements IActionQueue {
|
||||
|
||||
act.isScheduled = true;
|
||||
|
||||
if (!isParallel && act.unscheduledBefore != null)
|
||||
act.scheduleAllBefore(queue);
|
||||
if (!isParallel && act.unscheduledList != null) {
|
||||
act.unscheduledList.scheduleAll(this).forEach((act1) -> act1.unscheduledList = null).kill();
|
||||
return action;
|
||||
}
|
||||
|
||||
queue.addLast(action);
|
||||
|
||||
if (!isParallel && act.unscheduledAfter != null)
|
||||
act.scheduleAllAfter(queue);
|
||||
|
||||
return action;
|
||||
}
|
||||
|
||||
@@ -183,6 +182,7 @@ public class ActionQueue implements IActionQueue {
|
||||
queue.clear();
|
||||
queue.addAll(tmp);
|
||||
}
|
||||
((Action) action).queue = this;
|
||||
((Action) action).isScheduled = true;
|
||||
return action;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user