diff --git a/java/noppes/npcs/api/handler/IActionManager.java b/java/noppes/npcs/api/handler/IActionManager.java index 536ef62..f5489c5 100644 --- a/java/noppes/npcs/api/handler/IActionManager.java +++ b/java/noppes/npcs/api/handler/IActionManager.java @@ -19,7 +19,7 @@ public interface IActionManager { * @param action the consumer defining the action's behavior. * @return a new IAction instance. */ - IAction createAction(String name, int maxDuration, int startAfterTicks, Consumer action); + IAction create(String name, int maxDuration, int startAfterTicks, Consumer action); /** * Starts the action manager, enabling the processing of scheduled actions. @@ -36,7 +36,7 @@ public interface IActionManager { * * @param action the action to be scheduled. */ - void addScheduledAction(IAction action); + void scheduleAction(IAction action); /** * Creates and schedules an action with the given parameters. @@ -46,7 +46,7 @@ public interface IActionManager { * @param startAfterTicks the delay in ticks before the action starts. * @param action the consumer defining the action's behavior. */ - void addScheduledAction(String name, int maxDuration, int startAfterTicks, Consumer action); + void scheduleAction(String name, int maxDuration, int startAfterTicks, Consumer action); /** * Inserts an action into the action queue at the specified index. @@ -54,15 +54,8 @@ public interface IActionManager { * @param index the position in the queue where the action should be added. * @param action the action to insert. */ - void addScheduledActionAt(int index, IAction action); + void scheduleActionAt(int index, IAction action); - /** - * Schedules an action to be executed immediately after the specified action. - * - * @param after the action after which the new action should run. - * @param toSchedule the action to schedule. - */ - void scheduleActionAfter(IAction after, IAction toSchedule); /** * Retrieves the index of the specified action in the action queue. @@ -70,7 +63,7 @@ public interface IActionManager { * @param action the action whose index is to be determined. * @return the index of the action in the queue, or -1 if not found. */ - int getActionIndex(IAction action); + int getIndex(IAction action); /** * Gets the current action (the one at the head of the queue). diff --git a/java/noppes/npcs/api/handler/data/IAction.java b/java/noppes/npcs/api/handler/data/IAction.java index 59a710f..e268585 100644 --- a/java/noppes/npcs/api/handler/data/IAction.java +++ b/java/noppes/npcs/api/handler/data/IAction.java @@ -37,10 +37,8 @@ public interface IAction { /** * Marks the action as completed or not. - * - * @param done true to mark the action as done, false otherwise. */ - void setDone(boolean done); + void markDone(); /** * Checks if the action has been marked as completed. @@ -97,10 +95,21 @@ public interface IAction { */ IAction create(String name, int maxDuration, int startAfterTicks, Consumer action); + IAction getNext(); + + IAction getPrevious(); + /** * Schedules another action to be executed immediately after this action. * - * @param action the action to schedule after this one. + * @param after the action to schedule after this one. */ - void scheduleAfter(IAction action); + void scheduleAfter(IAction after); + + /** + * Schedules an action to be executed before current action, which pauses current until before finishes. + * + * @param before the action to schedule before this one. + */ + void scheduleBefore(IAction before); }