More ActionLogger and ActionThread optimisations

This commit is contained in:
bigguy345 committed 2025-07-08 11:34:32 +03:00
1 parent 66c4d64fb0
commit 7c24caf004
5 files changed
+59 -25

No files matched your search

@@ -261,18 +261,7 @@ public class ActionQueue implements IActionQueue {
///////////////////////////////////////////////////
// Handling
protected boolean tick(Action a) {
if (a == null)
return false;
if (manager.debug)
manager.LOGGER.push(this).log(String.format("Started ticking Action '%s' ", a.name), this).push(a);
a.tick();
if (manager.debug)
manager.LOGGER.pop().finish(String.format("Finished ticking Action '%s' ", a.name), this).pop();
public boolean finish(Action a) {
if (a.isDone()) {
if (a.onDone != null)
a.execute("done", a::executeOnDone);
@@ -286,6 +275,21 @@ public class ActionQueue implements IActionQueue {
return false;
}
protected boolean tick(Action a) {
if (a == null)
return false;
boolean wasDone = a.isDone();
if (manager.debug && !wasDone)
manager.LOGGER.push(this).log(String.format("Started ticking Action '%s' ", a.name), this).push(a);
a.tick();
if (manager.debug && !wasDone)
manager.LOGGER.pop().finish(String.format("Finished ticking Action '%s' ", a.name), this).pop();
return finish(a);
}
protected void tick() {
if (!isWorking || isDead)