Removed static modifier from ActionChain class

This commit is contained in:
bigguy345 committed 2025-04-28 06:52:44 +03:00
1 parent 9b846c314d
commit 48283b9f95
1 file changed
+4 -9
@@ -132,18 +132,13 @@ public class ScriptedActionManager implements IActionManager {
@Override
public IActionChain chain() {
return new ActionChain(this);
return new ActionChain();
}
/** helper to build a back‐to‐back chain of one‐shot actions */
public static class ActionChain implements IActionChain {
private final IActionManager mgr;
public class ActionChain implements IActionChain {
private int offset = 0, index = 0;
private ActionChain(IActionManager mgr) {
this.mgr = mgr;
}
/** schedule the next task ‘delay’ ticks after the previous one */
@Override
public IActionChain after(int delay, Consumer<IAction> task) {
@@ -152,9 +147,9 @@ public class ScriptedActionManager implements IActionManager {
task.accept(act);
act.markDone();
};
IAction a = mgr.create("chain#" + (index++), Integer.MAX_VALUE, offset, wrapper);
IAction a = create("chain#" + (index++), Integer.MAX_VALUE, offset, wrapper);
a.setUpdateEveryXTick(1);
mgr.scheduleAction(a);
scheduleAction(a);
return this;
}
}