From 16c3f641845e0dd4ac4e69670ea7bd8b5a01bb4e Mon Sep 17 00:00:00 2001 From: bigguy345 Date: Mon, 30 Jun 2025 09:32:26 +0300 Subject: [PATCH] Removed redundant schedulers --- .../npcs/api/handler/IActionManager.java | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/java/noppes/npcs/api/handler/IActionManager.java b/java/noppes/npcs/api/handler/IActionManager.java index 7e61cf0..831f59f 100644 --- a/java/noppes/npcs/api/handler/IActionManager.java +++ b/java/noppes/npcs/api/handler/IActionManager.java @@ -307,53 +307,6 @@ public interface IActionManager { */ void clear(); - /** - * Convenience: create and enqueue a normal repeating task. - */ - default IAction addTask(String name, int maxDuration, int delay, Consumer task) { - return schedule(name, maxDuration, delay, task); - } - - /** - * Convenience: create & enqueue a task that will fire exactly once - * after the given delay, and then auto-complete. - * - * @param name a unique name for this action - * @param delay delay before it runs (in ticks) - * @param task code to execute once - */ - default IAction addSingleTask(String name, int delay, Consumer task) { - IAction action = create(name, 1, delay, act -> { - task.accept(act); - act.markDone(); - }); - // force it to fire on the very next tick once the delay expires - action.setUpdateEveryXTick(1); - return schedule(action); - } - - /** - * Same as above, but fires immediately (no delay). - */ - default IAction addSingleTask(String name, Consumer task) { - return addSingleTask(name, 0, task); - } - - - /** - * Convenience: create & enqueue a conditional task that re-checks forever. - */ - default IConditionalAction addConditionalTask(String name, Function condition, Consumer task) { - return schedule(name, condition, task); - } - - /** - * Convenience: create & enqueue a conditional task that gives up after maxChecks. - */ - default IConditionalAction addConditionalTask(String name, Function condition, Consumer task, Function terminateWhen) { - return schedule(name, condition, task, terminateWhen); - } - /** * @param name action name to check for * @return true if action is scheduled in conditionalActions {@link #getConditionalActions()}