Record Class ClockState
java.lang.Object
java.lang.Record
net.minecraft.world.clock.ClockState
public record ClockState(long totalTicks, float partialTick, float rate, boolean paused)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<ClockState> private final floatThe field for thepartialTickrecord component.private final booleanThe field for thepausedrecord component.private final floatThe field for theraterecord component.private final longThe field for thetotalTicksrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionClockState(long totalTicks, float partialTick, float rate, boolean paused) Creates an instance of aClockStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatReturns the value of thepartialTickrecord component.booleanpaused()Returns the value of thepausedrecord component.floatrate()Returns the value of theraterecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalTicksrecord component.
-
Field Details
-
totalTicks
private final long totalTicksThe field for thetotalTicksrecord component. -
partialTick
private final float partialTickThe field for thepartialTickrecord component. -
rate
private final float rateThe field for theraterecord component. -
paused
private final boolean pausedThe field for thepausedrecord component. -
CODEC
-
-
Constructor Details
-
ClockState
public ClockState(long totalTicks, float partialTick, float rate, boolean paused) Creates an instance of aClockStaterecord class.- Parameters:
totalTicks- the value for thetotalTicksrecord componentpartialTick- the value for thepartialTickrecord componentrate- the value for theraterecord componentpaused- the value for thepausedrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
totalTicks
public long totalTicks()Returns the value of thetotalTicksrecord component.- Returns:
- the value of the
totalTicksrecord component
-
partialTick
public float partialTick()Returns the value of thepartialTickrecord component.- Returns:
- the value of the
partialTickrecord component
-
rate
public float rate()Returns the value of theraterecord component.- Returns:
- the value of the
raterecord component
-
paused
public boolean paused()Returns the value of thepausedrecord component.- Returns:
- the value of the
pausedrecord component
-