Class MinecraftTime
java.lang.Object
org.incendo.cloud.minecraft.modded.data.MinecraftTime
An element of in-game time.
The basic unit is 1 tick, which aims to be 50ms
-
Method Summary
Modifier and TypeMethodDescriptionlongconvertTo(@NonNull TemporalUnit unit) Convert this to another time unit.longConvert this to another time unit.booleaninthashCode()static @NonNull MinecraftTimeof(long ticks) Get the time instance for the specified number of ticks.static @NonNull MinecraftTimeof(long amount, @NonNull TemporalUnit unit) Given an amount of time in another unit, create a game time holding the number of ticks expected to pass in that time.static @NonNull MinecraftTimeGiven an amount of time in another unit, create a game time holding the number of ticks expected to pass in that time.intticks()Get the number of in-game ticks represented by this time.longGet the number of in-game ticks represented by this time.toString()
-
Method Details
-
of
Get the time instance for the specified number of ticks.- Parameters:
ticks- the number of ticks- Returns:
- a time holder
-
of
Given an amount of time in another unit, create a game time holding the number of ticks expected to pass in that time.- Parameters:
amount- the amount of timeunit- the unit- Returns:
- a time holder
-
of
Given an amount of time in another unit, create a game time holding the number of ticks expected to pass in that time.- Parameters:
amount- the amount of timeunit- the unit- Returns:
- a time holder
-
ticks
public int ticks()Get the number of in-game ticks represented by this time.This time will be truncated to the maximum value of an integer. See
ticksLong()for the full contents.- Returns:
- the time in ticks
-
ticksLong
public long ticksLong()Get the number of in-game ticks represented by this time.- Returns:
- the time in ticks
-
convertTo
Convert this to another time unit.- Parameters:
unit- the target unit- Returns:
- the target duration, as represented by the provided unit
-
convertTo
-
equals
-
hashCode
-
toString
-