Package xyz.xenondevs.particle.task
Class TaskManager
java.lang.Object
xyz.xenondevs.particle.task.TaskManager
A manager to handle different
ParticleTasks- Author:
- ByteZ
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic TaskManagerGet the singleton instance of theTaskManagerstatic intstartFilteredTask(List<Object> packets, int tickDelay, Predicate<org.bukkit.entity.Player> filter) Starts a newFilteredTask.static intstartGlobalTask(List<Object> packets, int tickDelay) Starts a newGlobalTask.static intstartSingularTask(List<Object> packets, int tickDelay, UUID target) Starts a newSingularTask.static intstartSingularTask(List<Object> packets, int tickDelay, org.bukkit.entity.Player target) Starts a newSingularTask.static intstartSuppliedTask(List<Object> packets, int tickDelay, Supplier<Collection<org.bukkit.entity.Player>> supplier) Starts a newSuppliedTask.static intstartTargetedTask(List<Object> packets, int tickDelay, Collection<org.bukkit.entity.Player> targets) Starts a newTargetedTask.intstartTask(ParticleTask task) Starts a new Timer for the given task.static intstartWorldTask(List<Object> packets, int tickDelay, org.bukkit.World world) Starts a newWorldTask.voidstopTask(int taskId) Stops a task that is currently running.
-
Method Details
-
startTask
Starts a new Timer for the given task.- Parameters:
task- the task that should be added to the scheduler- Returns:
- the id of the BukkitTask which can be cancelled using
stopTask(int) - See Also:
-
stopTask
public void stopTask(int taskId) Stops a task that is currently running.- Parameters:
taskId- the id of the task to be stopped.
-
getTaskManager
Get the singleton instance of theTaskManager- Returns:
- the singleton instance of the
TaskManager
-
startGlobalTask
Starts a newGlobalTask.- Parameters:
packets-Listof packetstickDelay- The delay of ticks between each execution- Returns:
- the id of the BukkitTask which can be cancelled using
stopTask(int) - See Also:
-
startWorldTask
Starts a newWorldTask.- Parameters:
packets-Listof packetstickDelay- The delay of ticks between each executionworld- The targetWorld- Returns:
- the id of the BukkitTask which can be cancelled using
stopTask(int) - See Also:
-
startTargetedTask
public static int startTargetedTask(List<Object> packets, int tickDelay, Collection<org.bukkit.entity.Player> targets) Starts a newTargetedTask.- Parameters:
packets-Listof packetstickDelay- The delay of ticks between each executiontargets- ACollectionofPlayersthat will receive the particles.- Returns:
- the id of the BukkitTask which can be cancelled using
stopTask(int) - See Also:
-
startSingularTask
Starts a newSingularTask.- Parameters:
packets-Listof packetstickDelay- The delay of ticks between each executiontarget- TheUUIDof the targetPlayer- Returns:
- the id of the BukkitTask which can be cancelled using
stopTask(int) - See Also:
-
startSingularTask
public static int startSingularTask(List<Object> packets, int tickDelay, org.bukkit.entity.Player target) Starts a newSingularTask.- Parameters:
packets-Listof packetstickDelay- The delay of ticks between each executiontarget- The targetPlayer- Returns:
- the id of the BukkitTask which can be cancelled using
stopTask(int) - See Also:
-
startFilteredTask
public static int startFilteredTask(List<Object> packets, int tickDelay, Predicate<org.bukkit.entity.Player> filter) Starts a newFilteredTask.- Parameters:
packets-Listof packetstickDelay- The delay of ticks between each executionfilter- ThePredicateto filter thePlayers- Returns:
- the id of the BukkitTask which can be cancelled using
stopTask(int) - See Also:
-
startSuppliedTask
public static int startSuppliedTask(List<Object> packets, int tickDelay, Supplier<Collection<org.bukkit.entity.Player>> supplier) Starts a newSuppliedTask.- Parameters:
packets-Listof packetstickDelay- The delay of ticks between each executionsupplier- TheSupplierused to retrieve theCollectionof targetPlayers- Returns:
- the id of the BukkitTask which can be cancelled using
stopTask(int) - See Also:
-