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
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.static final StreamCodec
<FriendlyByteBuf, ServerboundChatPacket> private final Instant
The field for thetimeStamp
record component. -
Constructor Summary
ModifierConstructorDescriptionServerboundChatPacket
(String message, Instant timeStamp, long salt, MessageSignature signature, LastSeenMessages.Update lastSeenMessages) Creates an instance of aServerboundChatPacket
record class.private
ServerboundChatPacket
(FriendlyByteBuf p_179545_) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.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.Returns the value of thetimeStamp
record component.final String
toString()
Returns a string representation of this record class.type()
private 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, isTerminal
-
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. -
lastSeenMessages
The field for thelastSeenMessages
record 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 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 componentlastSeenMessages
- the value for thelastSeenMessages
record component
-
-
Method Details
-
write
-
type
- Specified by:
type
in interfacePacket<ServerGamePacketListener>
-
handle
- Specified by:
handle
in 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 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
-
lastSeenMessages
Returns the value of thelastSeenMessages
record component.- Returns:
- the value of the
lastSeenMessages
record component
-