mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 13:29:43 +00:00
Fixed delay incorrectly calculated for sequential IActionChain
This commit is contained in:
1 parent
47dc56c25e
commit
7928c189ad
1 file changed
+2
-3
@@ -11,7 +11,7 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
public class ActionChain implements IActionChain {
|
||||
private final ScriptedActionManager manager;
|
||||
private int offset = 0, index = 0;
|
||||
private int index = 0;
|
||||
|
||||
public ActionChain(ScriptedActionManager scriptedActionManager) {
|
||||
this.manager = scriptedActionManager;
|
||||
@@ -22,9 +22,8 @@ public class ActionChain implements IActionChain {
|
||||
*/
|
||||
@Override
|
||||
public IActionChain after(int delay, String name, Consumer<IAction> task) {
|
||||
offset += delay;
|
||||
index++;
|
||||
manager.schedule(name, offset, task).updateEvery(1).once();
|
||||
manager.schedule(name, delay, task).updateEvery(1).once();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user