Class WorldSlumber

java.lang.Object
com.hypixel.hytale.builtin.beds.sleep.resources.WorldSlumber
All Implemented Interfaces:
WorldSleep

public final class WorldSlumber extends Object implements WorldSleep
A class that represents a world that is currently in slumber.
  • Constructor Details

    • WorldSlumber

      public WorldSlumber(@Nonnull Instant startInstant, @Nonnull Instant targetInstant, float irlDurationSeconds)
      Default Constructor for a WorldSlumber instance.
      Parameters:
      startInstant - The instant when the slumber started.
      targetInstant - The instant when the slumber is targeted to end.
      irlDurationSeconds - The time, in seconds, that the slumber will take.
  • Method Details

    • getStartInstant

      @Nonnull public Instant getStartInstant()
      Returns:
      the instant when the slumber started.
    • getTargetInstant

      @Nonnull public Instant getTargetInstant()
      Returns:
      the instant when the slumber is targeted to end.
    • getStartInstantData

      @Nonnull public InstantData getStartInstantData()
      Returns:
      the instant data when the slumber started.
    • getTargetInstantData

      @Nonnull public InstantData getTargetInstantData()
      Returns:
      the instant data when the slumber is targeted to end.
    • getProgressSeconds

      public float getProgressSeconds()
      Returns:
      the progress of the slumber, in seconds.
    • incrementProgressSeconds

      public void incrementProgressSeconds(float seconds)
      Called to increment the progress of the slumber.
      Parameters:
      seconds - The number of seconds to increment the progress by.
    • getIrlDurationSeconds

      public float getIrlDurationSeconds()
      Returns:
      the time, in seconds, that the slumber will take.
    • createSleepClock

      @Nonnull public SleepClock createSleepClock()
      Creates a SleepClock representing the current state of the slumber.
      Returns:
      a new SleepClock instance.