Class SchedulerProvider<C extends Chore<?>>
java.lang.Object
net.tnemc.plugincore.core.compatibility.scheduler.SchedulerProvider<C>
- Type Parameters:
C
- Represents the implementation'sChore
object.
- Direct Known Subclasses:
BukkitScheduler
,PaperScheduler
,SpongeScheduler
SchedulerProvider represents a bridge between the core and the implementation's scheduling
system.
- Since:
- 0.1.2.0
- Author:
- creatorfromhell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelTask
(int id) Used to cancel a task.abstract void
createDelayedTask
(Runnable task, ChoreTime delay, ChoreExecution environment) Used to create a task, which will execute after the specified delay.abstract C
createRepeatingTask
(Runnable task, ChoreTime delay, ChoreTime period, ChoreExecution environment) Used to create a task, which repeats after a specified period.int
createRepeatingTaskID
(Runnable task, ChoreTime delay, ChoreTime period, ChoreExecution environment) Used to create a task, which repeats after a specified period.
-
Constructor Details
-
SchedulerProvider
public SchedulerProvider()
-
-
Method Details
-
createDelayedTask
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
Used to cancel a task.- Parameters:
id
- The id of the task to cancel.
-