Class ChainTask
java.lang.Object
me.deecaad.weaponmechanics.weapon.reload.ChainTask
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetDelay()booleanhasNext()abstract voidonSchedule(com.cjcrafter.foliascheduler.TaskImplementation<Void> scheduledTask) Setup this task right after its delay counter has started (e.g.abstract voidDoes stuff when chain task is runsetNextTask(ChainTask nextTask) CompletableFuture<com.cjcrafter.foliascheduler.TaskImplementation<Void>> startChain(com.cjcrafter.foliascheduler.EntitySchedulerImplementation scheduler)
-
Constructor Details
-
ChainTask
public ChainTask(int delay)
-
-
Method Details
-
setNextTask
- Parameters:
nextTask- the next task in the chain- Returns:
- the next task that was set
-
getDelay
public int getDelay()- Returns:
- the delay after this task should be executed
-
startChain
@Nullable public CompletableFuture<com.cjcrafter.foliascheduler.TaskImplementation<Void>> startChain(com.cjcrafter.foliascheduler.EntitySchedulerImplementation scheduler) -
hasNext
public boolean hasNext() -
run
Does stuff when chain task is run -
onSchedule
public abstract void onSchedule(com.cjcrafter.foliascheduler.TaskImplementation<Void> scheduledTask) Setup this task right after its delay counter has started (e.g. store task id somewhere)
-