Class MycelScheduler

java.lang.Object
my.celium.org.schedule.MycelScheduler

public final class MycelScheduler extends Object
Safe scheduling helpers.
  • Method Details

    • runLater

      public static void runLater(long delayTicks, Runnable task)
      Runs task on the server thread after delayTicks server ticks. When no server is running yet, the task waits for the next server tick.
    • runEvery

      public static ScheduledTask runEvery(long intervalTicks, Runnable task)
      Runs task on the server thread every intervalTicks ticks. The returned handle cancels future runs (also cancelled automatically on server stop).
    • runAsync

      public static void runAsync(Runnable task)
      Runs task on Mycel's shared background pool. Never touch game state here.
    • runOnServer

      public static void runOnServer(Runnable task)
      Queues task onto the server thread. Safe to call from background threads; if no server is running the task is dropped with a warning.
    • isServerThread

      public static boolean isServerThread()
      Is the current thread the server thread? Useful for assertions in mod code.