Package ch.njol.skript.util
Class Timespan
java.lang.Object
ch.njol.skript.util.Timespan
- All Implemented Interfaces:
YggdrasilSerializable,Comparable<Timespan>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface ch.njol.yggdrasil.YggdrasilSerializable
YggdrasilSerializable.YggdrasilExtendedSerializable, YggdrasilSerializable.YggdrasilRobustEnum, YggdrasilSerializable.YggdrasilRobustSerializable -
Constructor Summary
ConstructorsConstructorDescriptionTimespan()Timespan(long millis) Builds a Timespan from the given milliseconds.Timespan(Timespan.TimePeriod timePeriod, long time) Builds a Timespan from the given long parameter of a specificTimespan.TimePeriod. -
Method Summary
Modifier and TypeMethodDescriptionintCompare this Timespan with anotherbooleanstatic TimespanfromTicks(long ticks) Deprecated.static TimespanfromTicks_i(long ticks) Deprecated.UsefromTicks(long)instead.longgetAs(Timespan.TimePeriod timePeriod) longDeprecated.longgetTicks()Deprecated.longDeprecated.Use getTicks() instead.inthashCode()static @Nullable TimespantoString()toString(int flags) static StringtoString(long millis) static StringtoString(long millis, int flags)
-
Constructor Details
-
Timespan
public Timespan() -
Timespan
public Timespan(long millis) Builds a Timespan from the given milliseconds.- Parameters:
millis- The milliseconds of Timespan
-
Timespan
Builds a Timespan from the given long parameter of a specificTimespan.TimePeriod.- Parameters:
timePeriod- The requested TimePeriodtime- The time of the requested TimePeriod
-
-
Method Details
-
parse
-
fromTicks
Deprecated.Builds a Timespan from the given long parameter.- Parameters:
ticks- The amount of Minecraft ticks to convert to a timespan.- Returns:
- Timespan based on the provided long.
-
fromTicks_i
Deprecated.UsefromTicks(long)instead. Old API naming changes. -
getMilliSeconds
Deprecated.- Returns:
- the amount of milliseconds this timespan represents.
-
getTicks
Deprecated.- Returns:
- the amount of Minecraft ticks this timespan represents.
-
getAs
- Returns:
- the amount of TimePeriod this timespan represents.
-
getTicks_i
Deprecated.Use getTicks() instead. Old API naming changes. -
toString
-
toString
-
toString
-
toString
-
compareTo
Compare this Timespan with another- Specified by:
compareToin interfaceComparable<Timespan>- Parameters:
time- the Timespan to be compared.- Returns:
- -1 if this Timespan is less than argument Timespan, 0 if equals and 1 if greater than
-
hashCode
public int hashCode() -
equals
-
Timespan(TimePeriod, long)