Package net.minestom.server.utils
Class TickUtils
java.lang.Object
net.minestom.server.utils.TickUtils
Tick related utilities.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intLength of time per tick for the default Java-edition client.static final intNumber of ticks per second for the default Java-edition client.
- 
Method SummaryModifier and TypeMethodDescriptionstatic intfromDuration(@NotNull Duration duration) Creates a number of ticks from a given duration, based onMinecraftServer.TICK_MS.static intfromDuration(@NotNull Duration duration, int msPerTick) Creates a number of ticks from a given duration.
- 
Field Details- 
CLIENT_TPSpublic static final int CLIENT_TPSNumber of ticks per second for the default Java-edition client.- See Also:
 
- 
CLIENT_TICK_MSpublic static final int CLIENT_TICK_MSLength of time per tick for the default Java-edition client.- See Also:
 
 
- 
- 
Method Details- 
fromDurationCreates a number of ticks from a given duration, based onMinecraftServer.TICK_MS.- Parameters:
- duration- the duration
- Returns:
- the number of ticks
- Throws:
- IllegalArgumentException- if duration is negative
 
- 
fromDurationCreates a number of ticks from a given duration.- Parameters:
- duration- the duration
- msPerTick- the number of milliseconds per tick
- Returns:
- the number of ticks
- Throws:
- IllegalArgumentException- if duration is negative
 
 
-