java.lang.Object
io.github.steveplays28.stevesrealisticsleep.util.SleepMathUtil

public class SleepMathUtil extends Object
  • Field Details

    • DAY_LENGTH

      public static final int DAY_LENGTH
      See Also:
    • DAWN_WAKE_UP_TIME

      public static final int DAWN_WAKE_UP_TIME
      See Also:
    • DUSK_WAKE_UP_TIME

      public static final int DUSK_WAKE_UP_TIME
      See Also:
    • WAKE_UP_GRACE_PERIOD_TICKS

      public static final double WAKE_UP_GRACE_PERIOD_TICKS
    • MINIMUM_SLEEP_TICKS_TO_CLEAR_WEATHER

      public static final int MINIMUM_SLEEP_TICKS_TO_CLEAR_WEATHER
      See Also:
  • Constructor Details

    • SleepMathUtil

      public SleepMathUtil()
  • Method Details

    • calculateTimeStepPerTick

      public static double calculateTimeStepPerTick(double sleepingRatio, double multiplier, double lastTimeStepPerTick)
    • calculateTicksToTimeOfDay

      public static int calculateTicksToTimeOfDay(int timeOfDay, int targetTimeOfDay)
    • calculateTicksUntilAwake

      public static int calculateTicksUntilAwake(int currentTimeOfDay)
    • calculateSecondsUntilAwake

      public static int calculateSecondsUntilAwake(int currentTimeOfDay, double timeStepPerTick, double tps)
    • getRandomNumberInRange

      public static double getRandomNumberInRange(double min, double max)
    • isNightTime

      public static boolean isNightTime(long currentTimeOfDay)