Class TaskUtil

java.lang.Object
com.github.darksoulq.abyssallib.server.util.TaskUtil

public class TaskUtil extends Object
Utility class for scheduling Bukkit tasks.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    cancelTask(org.bukkit.scheduler.BukkitTask task)
    Cancels a BukkitTask safely.
    static org.bukkit.scheduler.BukkitTask
    delayedAsyncTask(org.bukkit.plugin.Plugin plugin, int delay, Runnable task)
    Runs a task asynchronously once after a specified delay.
    static org.bukkit.scheduler.BukkitTask
    delayedTask(org.bukkit.plugin.Plugin plugin, int delay, Runnable task)
    Runs a task once after a specified delay.
    static org.bukkit.scheduler.BukkitTask
    repeatingAsyncTask(org.bukkit.plugin.Plugin plugin, int delay, int interval, Runnable task)
    Runs a task asynchronously repeatedly with a delay and interval.
    static org.bukkit.scheduler.BukkitTask
    repeatingTask(org.bukkit.plugin.Plugin plugin, int delay, int interval, Runnable task)
    Runs a task repeatedly with a delay and interval.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TaskUtil

      public TaskUtil()
  • Method Details

    • delayedTask

      public static org.bukkit.scheduler.BukkitTask delayedTask(org.bukkit.plugin.Plugin plugin, int delay, Runnable task)
      Runs a task once after a specified delay.
      Parameters:
      plugin - the plugin instance
      delay - delay in ticks before running the task
      task - the task to run
      Returns:
      the BukkitTask instance
    • repeatingTask

      public static org.bukkit.scheduler.BukkitTask repeatingTask(org.bukkit.plugin.Plugin plugin, int delay, int interval, Runnable task)
      Runs a task repeatedly with a delay and interval.
      Parameters:
      plugin - the plugin instance
      delay - delay in ticks before first run
      interval - interval in ticks between runs
      task - the task to run
      Returns:
      the BukkitTask instance
    • delayedAsyncTask

      public static org.bukkit.scheduler.BukkitTask delayedAsyncTask(org.bukkit.plugin.Plugin plugin, int delay, Runnable task)
      Runs a task asynchronously once after a specified delay.
      Parameters:
      plugin - the plugin instance
      delay - delay in ticks before running the task
      task - the task to run
      Returns:
      the BukkitTask instance
    • repeatingAsyncTask

      public static org.bukkit.scheduler.BukkitTask repeatingAsyncTask(org.bukkit.plugin.Plugin plugin, int delay, int interval, Runnable task)
      Runs a task asynchronously repeatedly with a delay and interval.
      Parameters:
      plugin - the plugin instance
      delay - delay in ticks before first run
      interval - interval in ticks between runs
      task - the task to run
      Returns:
      the BukkitTask instance
    • cancelTask

      public static void cancelTask(org.bukkit.scheduler.BukkitTask task)
      Cancels a BukkitTask safely.
      Parameters:
      task - the task to cancel