diff --git a/java/noppes/npcs/api/handler/IActionManager.java b/java/noppes/npcs/api/handler/IActionManager.java index 846614f..9f9fb84 100644 --- a/java/noppes/npcs/api/handler/IActionManager.java +++ b/java/noppes/npcs/api/handler/IActionManager.java @@ -32,6 +32,8 @@ public interface IActionManager { IAction create(String name, Consumer t); + IAction create(String name); + IAction create(Consumer t); /** diff --git a/java/noppes/npcs/api/handler/data/IAction.java b/java/noppes/npcs/api/handler/data/IAction.java index b83cd27..fe29858 100644 --- a/java/noppes/npcs/api/handler/data/IAction.java +++ b/java/noppes/npcs/api/handler/data/IAction.java @@ -10,7 +10,13 @@ import java.util.function.Consumer; public interface IAction { /** - * @return how many times this action’s {@code action.accept(this)} callback has run + * @param task code to execute each time the action fires + * @return + */ + IAction setTask(Consumer task); + + /** + * @return how many times this action’s {@code action.accept(this)} callback has run (or how many times task ran) */ int getCount(); @@ -29,6 +35,8 @@ public interface IAction { */ int getMaxDuration(); + IAction setMaxDuration(int x); + /** * Mark this action as complete. Once done, it will be removed on the next tick. */ @@ -55,6 +63,8 @@ public interface IAction { */ IAction addData(String key, Object value); + IAction removeData(String key); + /** * @return how many ticks between each invocation of the action callback */ @@ -72,6 +82,12 @@ public interface IAction { */ int getStartAfterTicks(); + /** + * @param ticks pauses action for this number of ticks (any subsequent action is paused too) + * @return + */ + IAction pauseFor(int ticks); + /** * @return the next action in the queue (or null if none or at end) */