Record Class PlayerChatMessagePacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.PlayerChatMessagePacket
- All Implemented Interfaces:
ComponentHolder<ServerPacket>,NetworkBuffer.Writer,ComponentHoldingServerPacket,SendablePacket,ServerPacket
public record PlayerChatMessagePacket(UUID sender, int index, byte @Nullable [] signature, @NotNull SignedMessageBody.Packed messageBody, @Nullable net.kyori.adventure.text.Component unsignedContent, FilterMask filterMask, int msgTypeId, net.kyori.adventure.text.Component msgTypeName, @Nullable net.kyori.adventure.text.Component msgTypeTarget)
extends Record
implements ComponentHoldingServerPacket
Represents an outgoing chat message packet.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerChatMessagePacket(UUID sender, int index, byte @Nullable [] signature, @NotNull SignedMessageBody.Packed messageBody, @Nullable net.kyori.adventure.text.Component unsignedContent, FilterMask filterMask, int msgTypeId, net.kyori.adventure.text.Component msgTypeName, @Nullable net.kyori.adventure.text.Component msgTypeTarget) Creates an instance of aPlayerChatMessagePacketrecord class.PlayerChatMessagePacket(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<net.kyori.adventure.text.Component> Gets the components held by this object.@NotNull ServerPacketcopyWithOperator(@NotNull UnaryOperator<net.kyori.adventure.text.Component> operator) Returns a copy of this object.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefilterMaskrecord component.intgetId(@NotNull ConnectionState state) Gets the id of this packet.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.@NotNull SignedMessageBody.PackedReturns the value of themessageBodyrecord component.intReturns the value of themsgTypeIdrecord component.net.kyori.adventure.text.ComponentReturns the value of themsgTypeNamerecord component.@Nullable net.kyori.adventure.text.ComponentReturns the value of themsgTypeTargetrecord component.sender()Returns the value of thesenderrecord component.byte @Nullable []Returns the value of thesignaturerecord component.final StringtoString()Returns a string representation of this record class.@Nullable net.kyori.adventure.text.ComponentReturns the value of theunsignedContentrecord component.voidwrite(@NotNull NetworkBuffer writer) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minestom.server.adventure.ComponentHolder
visitComponents
-
Constructor Details
-
PlayerChatMessagePacket
-
PlayerChatMessagePacket
public PlayerChatMessagePacket(UUID sender, int index, byte @Nullable [] signature, @NotNull SignedMessageBody.Packed messageBody, @Nullable @Nullable net.kyori.adventure.text.Component unsignedContent, FilterMask filterMask, int msgTypeId, net.kyori.adventure.text.Component msgTypeName, @Nullable @Nullable net.kyori.adventure.text.Component msgTypeTarget) Creates an instance of aPlayerChatMessagePacketrecord class.- Parameters:
sender- the value for thesenderrecord componentindex- the value for theindexrecord componentsignature- the value for thesignaturerecord componentmessageBody- the value for themessageBodyrecord componentunsignedContent- the value for theunsignedContentrecord componentfilterMask- the value for thefilterMaskrecord componentmsgTypeId- the value for themsgTypeIdrecord componentmsgTypeName- the value for themsgTypeNamerecord componentmsgTypeTarget- the value for themsgTypeTargetrecord component
-
-
Method Details
-
write
- Specified by:
writein interfaceNetworkBuffer.Writer
-
getId
Description copied from interface:ServerPacketGets the id of this packet.Written in the final buffer header so it needs to match the client id.
- Specified by:
getIdin interfaceServerPacket- Returns:
- the id of this packet
-
components
Description copied from interface:ComponentHolderGets the components held by this object.- Specified by:
componentsin interfaceComponentHolder<ServerPacket>- Returns:
- the components
-
copyWithOperator
@NotNull public @NotNull ServerPacket copyWithOperator(@NotNull @NotNull UnaryOperator<net.kyori.adventure.text.Component> operator) Description copied from interface:ComponentHolderReturns a copy of this object. For each component this object holds, the operator is applied to the copy before returning.- Specified by:
copyWithOperatorin interfaceComponentHolder<ServerPacket>- Parameters:
operator- the operator- Returns:
- the copy
-
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 '=='. -
sender
Returns the value of thesenderrecord component.- Returns:
- the value of the
senderrecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
signature
public byte @Nullable [] signature()Returns the value of thesignaturerecord component.- Returns:
- the value of the
signaturerecord component
-
messageBody
Returns the value of themessageBodyrecord component.- Returns:
- the value of the
messageBodyrecord component
-
unsignedContent
@Nullable public @Nullable net.kyori.adventure.text.Component unsignedContent()Returns the value of theunsignedContentrecord component.- Returns:
- the value of the
unsignedContentrecord component
-
filterMask
Returns the value of thefilterMaskrecord component.- Returns:
- the value of the
filterMaskrecord component
-
msgTypeId
public int msgTypeId()Returns the value of themsgTypeIdrecord component.- Returns:
- the value of the
msgTypeIdrecord component
-
msgTypeName
public net.kyori.adventure.text.Component msgTypeName()Returns the value of themsgTypeNamerecord component.- Returns:
- the value of the
msgTypeNamerecord component
-
msgTypeTarget
@Nullable public @Nullable net.kyori.adventure.text.Component msgTypeTarget()Returns the value of themsgTypeTargetrecord component.- Returns:
- the value of the
msgTypeTargetrecord component
-