Record Class ServerboundChatPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ServerboundChatPacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
public record ServerboundChatPacket(String message, Instant timeStamp, long salt, @Nullable MessageSignature signature, LastSeenMessages.Update lastSeenMessages)
extends Record
implements Packet<ServerGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LastSeenMessages.UpdateThe field for thelastSeenMessagesrecord component.private final StringThe field for themessagerecord component.private final longThe field for thesaltrecord component.private final MessageSignatureThe field for thesignaturerecord component.static final StreamCodec<FriendlyByteBuf, ServerboundChatPacket> private final InstantThe field for thetimeStamprecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionServerboundChatPacket(String message, Instant timeStamp, long salt, MessageSignature signature, LastSeenMessages.Update lastSeenMessages) Creates an instance of aServerboundChatPacketrecord class.privateServerboundChatPacket(FriendlyByteBuf p_179545_) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerGamePacketListener p_133836_) final inthashCode()Returns a hash code value for this object.Returns the value of thelastSeenMessagesrecord component.message()Returns the value of themessagerecord component.longsalt()Returns the value of thesaltrecord component.Returns the value of thesignaturerecord component.Returns the value of thetimeStamprecord component.final StringtoString()Returns a string representation of this record class.type()private voidwrite(FriendlyByteBuf p_133839_) 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
-
message
The field for themessagerecord component. -
timeStamp
The field for thetimeStamprecord component. -
salt
private final long saltThe field for thesaltrecord component. -
signature
The field for thesignaturerecord component. -
lastSeenMessages
The field for thelastSeenMessagesrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ServerboundChatPacket
-
ServerboundChatPacket
public ServerboundChatPacket(String message, Instant timeStamp, long salt, @Nullable MessageSignature signature, LastSeenMessages.Update lastSeenMessages) Creates an instance of aServerboundChatPacketrecord class.- Parameters:
message- the value for themessagerecord componenttimeStamp- the value for thetimeStamprecord componentsalt- the value for thesaltrecord componentsignature- the value for thesignaturerecord componentlastSeenMessages- the value for thelastSeenMessagesrecord component
-
-
Method Details
-
write
-
type
- Specified by:
typein interfacePacket<ServerGamePacketListener>
-
handle
- Specified by:
handlein interfacePacket<ServerGamePacketListener>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
timeStamp
Returns the value of thetimeStamprecord component.- Returns:
- the value of the
timeStamprecord component
-
salt
public long salt()Returns the value of thesaltrecord component.- Returns:
- the value of the
saltrecord component
-
signature
Returns the value of thesignaturerecord component.- Returns:
- the value of the
signaturerecord component
-
lastSeenMessages
Returns the value of thelastSeenMessagesrecord component.- Returns:
- the value of the
lastSeenMessagesrecord component
-