Class SchedulerWrapper

java.lang.Object
me.lokka30.levelledmobs.wrappers.SchedulerWrapper

public class SchedulerWrapper extends Object
This class is used for when code needs to be executed in a specific thread context. It allows for Folia servers to have code executed in the correct scheduler while providing compatibility for Paper / Spigot servers without needing to use different methods per server type
Since:
3.11.0
  • Field Details

    • runnable

      public Runnable runnable
    • entity

      @Nullable public @Nullable org.bukkit.entity.Entity entity
    • locationForRegionScheduler

      @Nullable public @Nullable org.bukkit.Location locationForRegionScheduler
    • runDirectlyInFolia

      public boolean runDirectlyInFolia
    • runDirectlyInBukkit

      public boolean runDirectlyInBukkit
  • Constructor Details

    • SchedulerWrapper

      public SchedulerWrapper()
    • SchedulerWrapper

      public SchedulerWrapper(Runnable runnable)
    • SchedulerWrapper

      public SchedulerWrapper(@Nullable @Nullable org.bukkit.entity.Entity entity)
    • SchedulerWrapper

      public SchedulerWrapper(@Nullable @Nullable org.bukkit.entity.Entity entity, Runnable runnable)
  • Method Details

    • run

      public void run()
    • runTaskTimerAsynchronously

      public SchedulerResult runTaskTimerAsynchronously(long delayMS, long periodMS)
    • runDelayed

      public SchedulerResult runDelayed(long delayInTicks)
    • getWillRunDirectly

      public boolean getWillRunDirectly()