diff --git a/java/noppes/npcs/api/handler/IActionManager.java b/java/noppes/npcs/api/handler/IActionManager.java index 1e3da63..7e26a5d 100644 --- a/java/noppes/npcs/api/handler/IActionManager.java +++ b/java/noppes/npcs/api/handler/IActionManager.java @@ -182,6 +182,18 @@ public interface IActionManager { */ IConditionalAction scheduleAction(String name, Supplier predicate, Consumer task, Supplier terminateWhen); + /** + * Schedule a conditional action that gives up after at most maxChecks attempts. + * + * @param name unique name + * @param predicate supplier checked every tick, if it returns true, task is fired + * @param task code to run once predicate first becomes true + * @param terminateWhen supplier checked every tick, if it returns true, action is terminated (gets marked done) + * @param onTermination code to run when the termination predicate returns true + * @return the action scheduled + */ + IConditionalAction scheduleAction(String name, Supplier predicate, Consumer task, Supplier terminateWhen, Consumer onTermination); + IConditionalAction scheduleAction(IConditionalAction action); /**