Class TaskWrapper

java.lang.Object
xyz.srnyx.annoyingapi.scheduler.TaskWrapper

public class TaskWrapper extends Object
A wrapper for Bukkit and Folia tasks
  • Field Details

  • Constructor Details

    • TaskWrapper

      public TaskWrapper(@NotNull @NotNull AnnoyingPlugin plugin)
      Create an empty TaskWrapper
      Use setTask(Object) once you have the task
    • TaskWrapper

      public TaskWrapper(@NotNull @NotNull AnnoyingPlugin plugin, @NotNull @NotNull Object task)
      Wrap a Bukkit or Folia task
      Parameters:
      task - task
  • Method Details

    • asBukkitTask

      @NotNull public @NotNull org.bukkit.scheduler.BukkitTask asBukkitTask()
      Return the task as a BukkitTask
      Returns:
      the task as a BukkitTask
    • cancel

      public void cancel()
      Cancel the task