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, MessageSignature signature, boolean signedPreview, LastSeenMessages.Update lastSeenMessages)
extends Record
implements Packet<ServerGamePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final LastSeenMessages.Update
The field for thelastSeenMessages
record component.private final String
The field for themessage
record component.private final long
The field for thesalt
record component.private final MessageSignature
The field for thesignature
record component.private final boolean
The field for thesignedPreview
record component.private final Instant
The field for thetimeStamp
record component. -
Constructor Summary
ConstructorDescriptionServerboundChatPacket
(String message, Instant timeStamp, long salt, MessageSignature signature, boolean signedPreview, LastSeenMessages.Update lastSeenMessages) Creates an instance of aServerboundChatPacket
record class.ServerboundChatPacket
(FriendlyByteBuf p_179545_) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.getSigner
(ServerPlayer p_241405_) void
handle
(ServerGamePacketListener p_133836_) final int
hashCode()
Returns a hash code value for this object.Returns the value of thelastSeenMessages
record component.message()
Returns the value of themessage
record component.long
salt()
Returns the value of thesalt
record component.Returns the value of thesignature
record component.boolean
Returns the value of thesignedPreview
record component.Returns the value of thetimeStamp
record component.final String
toString()
Returns a string representation of this record class.void
write
(FriendlyByteBuf p_133839_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable
-
Field Details
-
message
The field for themessage
record component. -
timeStamp
The field for thetimeStamp
record component. -
salt
private final long saltThe field for thesalt
record component. -
signature
The field for thesignature
record component. -
signedPreview
private final boolean signedPreviewThe field for thesignedPreview
record component. -
lastSeenMessages
The field for thelastSeenMessages
record component.
-
-
Constructor Details
-
ServerboundChatPacket
-
ServerboundChatPacket
public ServerboundChatPacket(String message, Instant timeStamp, long salt, MessageSignature signature, boolean signedPreview, LastSeenMessages.Update lastSeenMessages) Creates an instance of aServerboundChatPacket
record class.- Parameters:
message
- the value for themessage
record componenttimeStamp
- the value for thetimeStamp
record componentsalt
- the value for thesalt
record componentsignature
- the value for thesignature
record componentsignedPreview
- the value for thesignedPreview
record componentlastSeenMessages
- the value for thelastSeenMessages
record component
-
-
Method Details
-
write
- Specified by:
write
in interfacePacket<ServerGamePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ServerGamePacketListener>
-
getSigner
-
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 themessage
record component.- Returns:
- the value of the
message
record component
-
timeStamp
Returns the value of thetimeStamp
record component.- Returns:
- the value of the
timeStamp
record component
-
salt
public long salt()Returns the value of thesalt
record component.- Returns:
- the value of the
salt
record component
-
signature
Returns the value of thesignature
record component.- Returns:
- the value of the
signature
record component
-
signedPreview
public boolean signedPreview()Returns the value of thesignedPreview
record component.- Returns:
- the value of the
signedPreview
record component
-
lastSeenMessages
Returns the value of thelastSeenMessages
record component.- Returns:
- the value of the
lastSeenMessages
record component
-