mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 18:54:54 +00:00
More constructors and setters
This commit is contained in:
1 parent
06d73d7f11
commit
d053084ee0
2 files changed
+19
-1
No files matched your search
@@ -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<IAction> 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)
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user