Record Class ClockState
java.lang.Object
java.lang.Record
net.minecraft.world.clock.ClockState
public record ClockState(long totalTicks, boolean paused, float fractionalTick, float speed)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ClockState> private final floatThe field for thefractionalTickrecord component.private final booleanThe field for thepausedrecord component.private final floatThe field for thespeedrecord component.static final StreamCodec<RegistryFriendlyByteBuf, ClockState> private final longThe field for thetotalTicksrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionClockState(long totalTicks, boolean paused) ClockState(long totalTicks, boolean paused, float fractionalTick, float speed) Creates an instance of aClockStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.floatReturns the value of thefractionalTickrecord component.final inthashCode()Returns a hash code value for this object.booleanpaused()Returns the value of thepausedrecord component.floatspeed()Returns the value of thespeedrecord 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. -
paused
private final boolean pausedThe field for thepausedrecord component. -
fractionalTick
private final float fractionalTickThe field for thefractionalTickrecord component. -
speed
private final float speedThe field for thespeedrecord component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
ClockState
public ClockState(long totalTicks, boolean paused) -
ClockState
public ClockState(long totalTicks, boolean paused, float fractionalTick, float speed) Creates an instance of aClockStaterecord class.- Parameters:
totalTicks- the value for thetotalTicksrecord componentpaused- the value for thepausedrecord componentfractionalTick- the value for thefractionalTickrecord componentspeed- the value for thespeedrecord 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
-
paused
public boolean paused()Returns the value of thepausedrecord component.- Returns:
- the value of the
pausedrecord component
-
fractionalTick
public float fractionalTick()Returns the value of thefractionalTickrecord component.- Returns:
- the value of the
fractionalTickrecord component
-
speed
public float speed()Returns the value of thespeedrecord component.- Returns:
- the value of the
speedrecord component
-