Class TaskWrapper

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

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

    • task

      @NotNull public final @NotNull Object task
      The task object
    • type

      @NotNull public final @NotNull TaskWrapper.Type type
      The type of task
  • Constructor Details

    • TaskWrapper

      public TaskWrapper(@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