Record Class ClientboundSetTimePacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundSetTimePacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundSetTimePacket(long gameTime, long dayTime, boolean tickDayTime)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longThe field for thedayTimerecord component.private final longThe field for thegameTimerecord component.static final StreamCodec<FriendlyByteBuf, ClientboundSetTimePacket> private final booleanThe field for thetickDayTimerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionClientboundSetTimePacket(long gameTime, long dayTime, boolean tickDayTime) Creates an instance of aClientboundSetTimePacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongdayTime()Returns the value of thedayTimerecord component.final booleanIndicates whether some other object is "equal to" this one.longgameTime()Returns the value of thegameTimerecord component.voidhandle(ClientGamePacketListener pHandler) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thetickDayTimerecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
gameTime
private final long gameTimeThe field for thegameTimerecord component. -
dayTime
private final long dayTimeThe field for thedayTimerecord component. -
tickDayTime
private final boolean tickDayTimeThe field for thetickDayTimerecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundSetTimePacket
public ClientboundSetTimePacket(long gameTime, long dayTime, boolean tickDayTime) Creates an instance of aClientboundSetTimePacketrecord class.- Parameters:
gameTime- the value for thegameTimerecord componentdayTime- the value for thedayTimerecord componenttickDayTime- the value for thetickDayTimerecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ClientGamePacketListener>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
gameTime
public long gameTime()Returns the value of thegameTimerecord component.- Returns:
- the value of the
gameTimerecord component
-
dayTime
public long dayTime()Returns the value of thedayTimerecord component.- Returns:
- the value of the
dayTimerecord component
-
tickDayTime
public boolean tickDayTime()Returns the value of thetickDayTimerecord component.- Returns:
- the value of the
tickDayTimerecord component
-