Class ChainTask

java.lang.Object
me.deecaad.weaponmechanics.weapon.reload.ChainTask

public abstract class ChainTask extends Object
  • Constructor Details

    • ChainTask

      public ChainTask(int delay)
  • Method Details

    • setNextTask

      public ChainTask setNextTask(ChainTask nextTask)
      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

      public abstract void run(com.cjcrafter.foliascheduler.TaskImplementation<Void> scheduledTask)
      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)