mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 10:44:47 +00:00
IActionManager and IAction QoL
This commit is contained in:
1 parent
8ad0c21ef4
commit
4d8b345a42
2 files changed
+33
-5
No files matched your search
@@ -77,7 +77,8 @@ public interface IAction {
|
||||
boolean hasData(String key);
|
||||
|
||||
/**
|
||||
* @return how many ticks between each invocation of the action callback
|
||||
* @return how many ticks between each execution of the action's task
|
||||
* Default is 5 ticks (4 times per second)
|
||||
*/
|
||||
int getUpdateEveryXTick();
|
||||
|
||||
@@ -117,11 +118,13 @@ public interface IAction {
|
||||
|
||||
/**
|
||||
* Resumes thread that was previously paused by {@link #pause()}, {@link #pauseUntil(Supplier)}, {@link #pauseFor(int)} or {@link #pauseFor(long)}
|
||||
* Must be called from a different thread than the IAction one, as that one is paused, so it won't reach this function if it comes after any of the pausing functions.
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* @return checks if IAction's getStartAfterTicks > 0, or if IAction's thread is paused if threaded
|
||||
* Preferably called from a different thread than the IAction one if it's paused.
|
||||
*/
|
||||
boolean isPaused();
|
||||
|
||||
@@ -130,6 +133,12 @@ public interface IAction {
|
||||
*/
|
||||
IAction threadify();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return starts the IActionManager
|
||||
*/
|
||||
IAction start();
|
||||
|
||||
/**
|
||||
* @return the next action in the queue (or null if none or at end)
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user