Interface ITime


public interface ITime
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    sleep(int min, int max)
    Sleeps for a random amount of time between a given range.
    boolean
    sleep(long ms)
    Sleep will not execute on the client thread, as this may hang the client.
    default boolean
    Sleeps for one game tick.
    boolean
    sleepTicks(int ticks)
    Sleeps for given amount of ticks.
    boolean
    sleepTicksUntil(BooleanSupplier supplier, int ticks)
    Sleeps for given amount of ticks, or until given condition is true.
    default boolean
    sleepUntil(BooleanSupplier supplier, int timeOut)
    Sleeps until the given condition is true.
    default boolean
    sleepUntil(BooleanSupplier supplier, int pollingRate, int timeOut)
    Sleeps until the given condition is true.
    default boolean
    sleepUntil(BooleanSupplier supplier, BooleanSupplier resetSupplier, int timeOut)
    Sleeps until the given condition is true.
    boolean
    sleepUntil(BooleanSupplier supplier, BooleanSupplier resetSupplier, int pollingRate, int timeOut)
    Sleeps until the given condition is true.
  • Field Details

  • Method Details

    • sleep

      boolean sleep(long ms)
      Sleep will not execute on the client thread, as this may hang the client.
      Parameters:
      ms - The amount of milliseconds to sleep.
      Returns:
      Whether the sleep call was successful.
    • sleep

      boolean sleep(int min, int max)
      Sleeps for a random amount of time between a given range. Sleep will not execute on the client thread, as this may hang the client.
      Parameters:
      min - The minimum amount of milliseconds to sleep.
      max - The maximum amount of milliseconds to sleep.
      Returns:
      Whether the sleep call was successful.
    • sleepUntil

      boolean sleepUntil(BooleanSupplier supplier, BooleanSupplier resetSupplier, int pollingRate, int timeOut)
      Sleeps until the given condition is true. Sleep will not execute on the client thread, as this may hang the client.
      Parameters:
      supplier - The completion condition.
      resetSupplier - The condition to reset the sleep timer.
      pollingRate - The amount of time to check whether the given conditions are true.
      timeOut - The amount of time until a timeout.
      Returns:
      Whether the sleep call was successful.
    • sleepUntil

      default boolean sleepUntil(BooleanSupplier supplier, BooleanSupplier resetSupplier, int timeOut)
      Sleeps until the given condition is true. Sleep will not execute on the client thread, as this may hang the client.
      Parameters:
      supplier - The completion condition.
      resetSupplier - The condition to reset the sleep timer.
      timeOut - The amount of time until a timeout.
      Returns:
      Whether the sleep call was successful.
    • sleepUntil

      default boolean sleepUntil(BooleanSupplier supplier, int pollingRate, int timeOut)
      Sleeps until the given condition is true. Sleep will not execute on the client thread, as this may hang the client.
      Parameters:
      supplier - The completion condition.
      pollingRate - The amount of time to check whether the given conditions are true.
      timeOut - The amount of time until a timeout.
      Returns:
      Whether the sleep call was successful.
    • sleepUntil

      default boolean sleepUntil(BooleanSupplier supplier, int timeOut)
      Sleeps until the given condition is true. Sleep will not execute on the client thread, as this may hang the client.
      Parameters:
      supplier - The completion condition.
      timeOut - The amount of time until a timeout.
      Returns:
      Whether the sleep call was successful.
    • sleepTicks

      boolean sleepTicks(int ticks)
      Sleeps for given amount of ticks. Sleep will not execute on the client thread, as this may hang the client.
      Parameters:
      ticks - Amount of time to sleep in ticks.
      Returns:
      Whether the sleep call was successful.
    • sleepTick

      default boolean sleepTick()
      Sleeps for one game tick. Sleep will not execute on the client thread, as this may hang the client.
      Returns:
      Whether the sleep call was successful.
    • sleepTicksUntil

      boolean sleepTicksUntil(BooleanSupplier supplier, int ticks)
      Sleeps for given amount of ticks, or until given condition is true.
      Parameters:
      supplier - The break condition.
      ticks - Max. amount of ticks to sleep.
      Returns:
      Whether the sleep call was successful.