Class Time

java.lang.Object
ch.njol.skript.util.Time
All Implemented Interfaces:
YggdrasilSerializable, Cyclical<Integer>

public class Time extends Object implements YggdrasilSerializable, Cyclical<Integer>
  • Constructor Details

    • Time

      public Time()
    • Time

      public Time(int time)
  • Method Details

    • getTicks

      public int getTicks()
      Returns:
      Ticks in Minecraft time (0 ticks == 6:00)
    • getTime

      public int getTime()
      Returns:
      Ticks in day time (0 ticks == 0:00)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public static String toString(int ticks)
    • parse

      public static @Nullable Time parse(String s)
      Parameters:
      s - The trim()med string to parse
      Returns:
      The parsed time of null if the input was invalid
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • getMaximum

      public Integer getMaximum()
      Description copied from interface: Cyclical
      The potential 'top' of the cycle, e.g. the highest value after which this should restart. In practice, nothing forces this, so you can write 24:00 or 361° instead of 00:00 and 1° respectively.
      Specified by:
      getMaximum in interface Cyclical<Integer>
      Returns:
      the highest legal value
    • getMinimum

      public Integer getMinimum()
      Description copied from interface: Cyclical
      The potential 'bottom' of the cycle, e.g. the lowest value. In practice, nothing forces this, so 24:00 is synonymous with 00:00.
      Specified by:
      getMinimum in interface Cyclical<Integer>
      Returns:
      the lowest legal value