Interface Scheduler
- All Known Implementing Classes:
BukkitScheduler,FoliaScheduler
public interface Scheduler
The scheduler
-
Method Summary
Modifier and TypeMethodDescriptionasync()Get theRunnerfor asynchronous tasksvoidCancel all tasksstatic Schedulercurrent()static <T extends org.bukkit.plugin.java.JavaPlugin>
SchedulerGet theSchedulerfor the givenJavaPluginstatic Schedulerplugin(org.bukkit.plugin.Plugin plugin) Get theSchedulerfor the givenPluginstatic SchedulerprovidingPlugin(Class<?> clazz) Get theSchedulerfor theJavaPluginthat provides the classdefault Runnerrunner(boolean async) Get theRunnerfor the given typesync()Get theRunnerfor synchronous tasks
-
Method Details
-
plugin
Get theSchedulerfor the givenPlugin- Parameters:
plugin- the plugin- Returns:
- the scheduler
-
plugin
Get theSchedulerfor the givenJavaPlugin- Type Parameters:
T- the plugin type- Parameters:
clazz- the plugin class- Returns:
- the scheduler
-
providingPlugin
Get theSchedulerfor theJavaPluginthat provides the class- Parameters:
clazz- the class- Returns:
- the scheduler
-
current
- Returns:
- the scheduler
-
cancelAllTasks
void cancelAllTasks()Cancel all tasks -
async
Runner async()Get theRunnerfor asynchronous tasks- Returns:
- the
Runner
-
sync
Runner sync()Get theRunnerfor synchronous tasks- Returns:
- the
Runner
-
runner
Get theRunnerfor the given type- Parameters:
async- the type- Returns:
- the
Runner
-