Class TaskWrapper
java.lang.Object
io.github.retrooper.packetevents.util.folia.TaskWrapper
Represents a wrapper around
BukkitTask
and Paper's ScheduledTask
.
This class provides a unified interface for interacting with both Bukkit's task scheduler
and Paper's task scheduler.-
Constructor Summary
ConstructorDescriptionTaskWrapper
(@NotNull io.papermc.paper.threadedregions.scheduler.ScheduledTask scheduledTask) Constructs a new TaskWrapper around Paper's ScheduledTask.TaskWrapper
(@NotNull org.bukkit.scheduler.BukkitTask bukkitTask) Constructs a new TaskWrapper around a BukkitTask. -
Method Summary
-
Constructor Details
-
TaskWrapper
public TaskWrapper(@NotNull @NotNull org.bukkit.scheduler.BukkitTask bukkitTask) Constructs a new TaskWrapper around a BukkitTask.- Parameters:
bukkitTask
- the BukkitTask to wrap
-
TaskWrapper
public TaskWrapper(@NotNull @NotNull io.papermc.paper.threadedregions.scheduler.ScheduledTask scheduledTask) Constructs a new TaskWrapper around Paper's ScheduledTask.- Parameters:
scheduledTask
- the ScheduledTask to wrap
-
-
Method Details
-
getOwner
public org.bukkit.plugin.Plugin getOwner()Retrieves the Plugin that owns this task.- Returns:
- the owning
Plugin
-
isCancelled
public boolean isCancelled()Checks if the task is canceled.- Returns:
- true if the task is canceled, false otherwise
-
cancel
public void cancel()Cancels the task. If the task is running, it will be canceled.
-