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 @Nullable 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, @Nullable MessageSignature signature, LastSeenMessages.Update lastSeenMessages) Creates an instance of aServerboundChatPacketrecord class.private -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerGamePacketListener listener) Passes this Packet on to the NetHandler for processing.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.@Nullable MessageSignatureReturns 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 output) Writes the raw packet data to the data stream.Methods inherited from interface 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
Writes the raw packet data to the data stream. -
type
- Specified by:
typein interfacePacket<ServerGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ServerGamePacketListener>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
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
-