Package net.minestom.server.utils
Class TickUtils
java.lang.Object
net.minestom.server.utils.TickUtils
Tick related utilities.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Length of time per tick for the default Java-edition client.static final int
Number of ticks per second for the default Java-edition client. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
fromDuration
(@NotNull Duration duration) Creates a number of ticks from a given duration, based onMinecraftServer.TICK_MS
.static int
fromDuration
(@NotNull Duration duration, int msPerTick) Creates a number of ticks from a given duration.
-
Field Details
-
CLIENT_TPS
public static final int CLIENT_TPSNumber of ticks per second for the default Java-edition client.- See Also:
-
CLIENT_TICK_MS
public static final int CLIENT_TICK_MSLength of time per tick for the default Java-edition client.- See Also:
-
-
Constructor Details
-
TickUtils
public TickUtils()
-
-
Method Details
-
fromDuration
Creates 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
-
fromDuration
Creates a number of ticks from a given duration.- Parameters:
duration
- the durationmsPerTick
- the number of milliseconds per tick- Returns:
- the number of ticks
- Throws:
IllegalArgumentException
- if duration is negative
-