Package dev.demeng.pluginbase.scheduler
Class Ticks
java.lang.Object
dev.demeng.pluginbase.scheduler.Ticks
Utility for converting between Minecraft game ticks and standard durations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
TICKS_PER_SECOND
public static final int TICKS_PER_SECOND- See Also:
-
MILLISECONDS_PER_SECOND
public static final int MILLISECONDS_PER_SECOND- See Also:
-
MILLISECONDS_PER_TICK
public static final int MILLISECONDS_PER_TICK- See Also:
-
-
Constructor Details
-
Ticks
public Ticks()
-
-
Method Details
-
from
Converts a duration in a certain unit of time to ticks.Ticks.from(duration)returns the number of ticks from the given duration.- Parameters:
duration- the duration of timeunit- the unit the duration is in- Returns:
- the number of ticks which represent the duration
-
to
Converts ticks to a duration in a certain unit of time.Ticks.to(ticks)converts the number of ticks to a duration.- Parameters:
ticks- the number of ticksunit- the unit to return the duration in- Returns:
- a duration value in the given unit, representing the number of ticks
-