mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-15 16:04:44 +00:00
Added terminateWhen predicate for ConditionalAction
This commit is contained in:
1 parent
f6fac38360
commit
581cf4268b
1 file changed
+12
@@ -103,6 +103,18 @@ public interface IActionManager {
|
||||
*/
|
||||
void scheduleConditionalAction(String name, int checkIntervalTicks, Supplier<Boolean> predicate, Consumer<IAction> task, int maxChecks);
|
||||
|
||||
/**
|
||||
* Schedule a conditional action that gives up after at most maxChecks attempts.
|
||||
*
|
||||
* @param name unique name
|
||||
* @param checkIntervalTicks ticks between predicate tests
|
||||
* @param predicate supplier returning true when it should fire
|
||||
* @param terminateWhen supplier returning true when it should terminate (gets marked done)
|
||||
* @param task logic to run once when predicate first becomes true
|
||||
* @param maxChecks maximum times to test predicate before auto‐cancelling
|
||||
*/
|
||||
void scheduleConditionalAction(String name, int checkIntervalTicks, Supplier<Boolean> predicate, Supplier<Boolean> terminateWhen, Consumer<IAction> task, int maxChecks);
|
||||
|
||||
/**
|
||||
* Cancel (remove) the first queued action with the given name.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user