Class SchedulerProvider<C extends Chore<?>>

java.lang.Object
net.tnemc.plugincore.core.compatibility.scheduler.SchedulerProvider<C>
Type Parameters:
C - Represents the implementation's Chore object.
Direct Known Subclasses:
BukkitScheduler, PaperScheduler, SpongeScheduler

public abstract class SchedulerProvider<C extends Chore<?>> extends Object
SchedulerProvider represents a bridge between the core and the implementation's scheduling system.
Since:
0.1.2.0
Author:
creatorfromhell
  • Constructor Details

  • Method Details

    • createDelayedTask

      public abstract void createDelayedTask(Runnable task, ChoreTime delay, ChoreExecution environment)
      Used to create a task, which will execute after the specified delay.
      Parameters:
      task - The task to run.
      delay - The delay, in ticks.
      environment - The execution environment for the task.
    • createRepeatingTask

      public abstract C createRepeatingTask(Runnable task, ChoreTime delay, ChoreTime period, ChoreExecution environment)
      Used to create a task, which repeats after a specified period.
      Parameters:
      task - The task to run.
      delay - The delay to run the task, in ticks.
      period - The period to run the task.
      environment - The execution environment for the task.
      Returns:
      The associated Chore with this task.
    • createRepeatingTaskID

      public int createRepeatingTaskID(Runnable task, ChoreTime delay, ChoreTime period, ChoreExecution environment)
      Used to create a task, which repeats after a specified period.
      Parameters:
      task - The task to run.
      delay - The delay to run the task, in ticks.
      period - The period to run the task.
      Returns:
      The id, or -1 if no id can be returned.
    • cancelTask

      public void cancelTask(int id)
      Used to cancel a task.
      Parameters:
      id - The id of the task to cancel.