mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 14:14:48 +00:00
More conditional create and chain methods
This commit is contained in:
1 parent
d4ad1450e1
commit
5a12178a92
2 files changed
+24
No files matched your search
@@ -33,6 +33,14 @@ public interface IActionManager {
|
||||
|
||||
IAction create(Consumer<IAction> t);
|
||||
|
||||
IConditionalAction create(Supplier<Boolean> predicate, Consumer<IAction> task);
|
||||
|
||||
IConditionalAction create(String name, Supplier<Boolean> predicate, Consumer<IAction> task);
|
||||
|
||||
IConditionalAction create(Supplier<Boolean> predicate, Supplier<Boolean> terminate, Consumer<IAction> task);
|
||||
|
||||
IConditionalAction create(String name, Supplier<Boolean> predicate, Supplier<Boolean> terminate, Consumer<IAction> task);
|
||||
|
||||
/**
|
||||
* Begin processing scheduled actions. Must be called once.
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,23 @@ package noppes.npcs.api.handler.data.actions;
|
||||
|
||||
import noppes.npcs.api.handler.data.IAction;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public interface IConditionalAction extends IAction {
|
||||
|
||||
IConditionalAction setMaxChecks(int maxChecks);
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////
|
||||
//Before chains
|
||||
IConditionalAction after(IConditionalAction after);
|
||||
|
||||
IConditionalAction after(Supplier<Boolean> predicate, Consumer<IAction> task);
|
||||
|
||||
IConditionalAction after(String name, Supplier<Boolean> predicate, Consumer<IAction> task);
|
||||
|
||||
IConditionalAction after(Supplier<Boolean> predicate, Supplier<Boolean> terminate, Consumer<IAction> task);
|
||||
|
||||
IConditionalAction after(String name, Supplier<Boolean> predicate, Supplier<Boolean> terminate, Consumer<IAction> task);
|
||||
}
|
||||
Reference in new issue
Block a user