Enum Class Time

java.lang.Object
java.lang.Enum<Time>
fr.hytale.loader.api.Time
All Implemented Interfaces:
Serializable, Comparable<Time>, Constable

public enum Time extends Enum<Time>
Represents specific times of day in Hytale.

This enum makes it easier to set the world time to common presets. Values assume a standard 24-hour cycle where 0.0 is midnight and 0.5 is noon.

Since:
1.0.6
Version:
1.0.6
Author:
HytaleLoader
  • Enum Constant Details

    • DAWN

      public static final Time DAWN
      06:00 AM - Early morning
    • MORNING

      public static final Time MORNING
      08:00 AM - Morning
    • NOON

      public static final Time NOON
      12:00 PM - High noon
    • AFTERNOON

      public static final Time AFTERNOON
      16:00 PM - Afternoon
    • DUSK

      public static final Time DUSK
      18:00 PM - Evening/Sunset
    • MIDNIGHT

      public static final Time MIDNIGHT
      00:00 AM - Midnight
  • Method Details

    • values

      public static Time[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Time valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPercent

      public float getPercent()
      Gets the time value as a percentage of the day (0.0 to 1.0).
      Returns:
      the time percentage (0.0 = midnight, 0.5 = noon)