Class FoliaCompatUtil

java.lang.Object
io.github.retrooper.packetevents.util.FoliaCompatUtil

@Deprecated public class FoliaCompatUtil extends Object
Deprecated.
This class has been moved to FoliaScheduler.
  • Constructor Details

    • FoliaCompatUtil

      public FoliaCompatUtil()
      Deprecated.
  • Method Details

    • isFolia

      public static boolean isFolia()
      Deprecated.
      This method has been moved to FoliaScheduler.isFolia().
      Returns:
      Whether the server is running Folia
    • runTaskAsync

      public static void runTaskAsync(org.bukkit.plugin.Plugin plugin, Runnable run)
      Deprecated.
      This method is deprecated, and it's recommended to use FoliaScheduler.getAsyncScheduler() instead.
      Run a task async, either with Bukkit scheduler or using Java
      Parameters:
      plugin - Your plugin or PacketEvents
      run - Runnable to run
    • runTaskTimerAsync

      public static void runTaskTimerAsync(org.bukkit.plugin.Plugin plugin, Consumer<Object> run, long delay, long period)
      Deprecated.
      This method is deprecated, and it's recommended to use FoliaScheduler.getAsyncScheduler() instead.
      Run a task every global tick
      Parameters:
      plugin - Your plugin or PacketEvents
      run - Consumer that accepts an object or null, for Folia or Paper/Spigot respectively
      delay - Delay in ticks
      period - Period in ticks
    • runTask

      public static void runTask(org.bukkit.plugin.Plugin plugin, Consumer<Object> run)
      Deprecated.
      This method is deprecated, and it's recommended to use FoliaScheduler.getGlobalRegionScheduler() or another suitable scheduler instead.
      Run a task on the next global tick
      Parameters:
      plugin - Your plugin or PacketEvents
      run - Consumer that accepts an object or null, for Folia or Paper/Spigot respectively
    • runTaskOnInit

      public static void runTaskOnInit(org.bukkit.plugin.Plugin plugin, Runnable run)
      Deprecated.
      This method has been moved to FoliaScheduler.runTaskOnInit(Plugin, Runnable).
      Run a task after the server has finished initializing. Undefined behavior if called after the server has finished initializing.
      Parameters:
      plugin - Your plugin or PacketEvents
      run - The task to run
    • runTaskForEntity

      public static void runTaskForEntity(org.bukkit.entity.Entity entity, org.bukkit.plugin.Plugin plugin, Runnable run, Runnable retired, long delay)
      Deprecated.
      This method is deprecated, and it's recommended to use FoliaScheduler.getEntityScheduler().
      Run a task for an entity on whatever thread the entity is on
      Parameters:
      entity - The entity to run the task for
      plugin - Your plugin or PacketEvents
      run - The task to run
      retired - The task to run if entity is retired before the task is run
      delay - Delay in ticks