Record Class PlayerChatMessagePacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.PlayerChatMessagePacket
- All Implemented Interfaces:
ComponentHolder<ServerPacket>
,NetworkBuffer.Writer
,SendablePacket
,ServerPacket
,ServerPacket.ComponentHolding
,ServerPacket.Play
public record PlayerChatMessagePacket(UUID sender, int index, byte @Nullable [] signature, @NotNull SignedMessageBody.Packed messageBody, @Nullable Component unsignedContent, FilterMask filterMask, int msgTypeId, Component msgTypeName, @Nullable Component msgTypeTarget)
extends Record
implements ServerPacket.Play, ServerPacket.ComponentHolding
Represents an outgoing chat message packet.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minestom.server.network.packet.server.ServerPacket
ServerPacket.ComponentHolding, ServerPacket.Configuration, ServerPacket.Login, ServerPacket.Play, ServerPacket.Status
-
Constructor Summary
ConstructorDescriptionPlayerChatMessagePacket
(UUID sender, int index, byte @Nullable [] signature, @NotNull SignedMessageBody.Packed messageBody, @Nullable Component unsignedContent, FilterMask filterMask, int msgTypeId, Component msgTypeName, @Nullable Component msgTypeTarget) Creates an instance of aPlayerChatMessagePacket
record class.PlayerChatMessagePacket
(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection
<Component> Gets the components held by this object.@NotNull ServerPacket
copyWithOperator
(@NotNull UnaryOperator<Component> operator) Returns a copy of this object.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefilterMask
record component.final int
hashCode()
Returns a hash code value for this object.int
index()
Returns the value of theindex
record component.@NotNull SignedMessageBody.Packed
Returns the value of themessageBody
record component.int
Returns the value of themsgTypeId
record component.Returns the value of themsgTypeName
record component.@Nullable Component
Returns the value of themsgTypeTarget
record component.int
playId()
sender()
Returns the value of thesender
record component.byte @Nullable []
Returns the value of thesignature
record component.final String
toString()
Returns a string representation of this record class.@Nullable Component
Returns the value of theunsignedContent
record component.void
write
(@NotNull NetworkBuffer writer) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minestom.server.adventure.ComponentHolder
visitComponents
Methods inherited from interface net.minestom.server.network.packet.server.ServerPacket
getId
-
Constructor Details
-
PlayerChatMessagePacket
-
PlayerChatMessagePacket
public PlayerChatMessagePacket(UUID sender, int index, byte @Nullable [] signature, @NotNull SignedMessageBody.Packed messageBody, @Nullable @Nullable Component unsignedContent, FilterMask filterMask, int msgTypeId, Component msgTypeName, @Nullable @Nullable Component msgTypeTarget) Creates an instance of aPlayerChatMessagePacket
record class.- Parameters:
sender
- the value for thesender
record componentindex
- the value for theindex
record componentsignature
- the value for thesignature
record componentmessageBody
- the value for themessageBody
record componentunsignedContent
- the value for theunsignedContent
record componentfilterMask
- the value for thefilterMask
record componentmsgTypeId
- the value for themsgTypeId
record componentmsgTypeName
- the value for themsgTypeName
record componentmsgTypeTarget
- the value for themsgTypeTarget
record component
-
-
Method Details
-
write
- Specified by:
write
in interfaceNetworkBuffer.Writer
-
playId
public int playId()- Specified by:
playId
in interfaceServerPacket.Play
-
components
Description copied from interface:ComponentHolder
Gets the components held by this object.- Specified by:
components
in interfaceComponentHolder<ServerPacket>
- Returns:
- the components
-
copyWithOperator
@NotNull public @NotNull ServerPacket copyWithOperator(@NotNull @NotNull UnaryOperator<Component> operator) Description copied from interface:ComponentHolder
Returns a copy of this object. For each component this object holds, the operator is applied to the copy before returning.- Specified by:
copyWithOperator
in 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 thesender
record component.- Returns:
- the value of the
sender
record component
-
index
public int index()Returns the value of theindex
record component.- Returns:
- the value of the
index
record component
-
signature
public byte @Nullable [] signature()Returns the value of thesignature
record component.- Returns:
- the value of the
signature
record component
-
messageBody
Returns the value of themessageBody
record component.- Returns:
- the value of the
messageBody
record component
-
unsignedContent
Returns the value of theunsignedContent
record component.- Returns:
- the value of the
unsignedContent
record component
-
filterMask
Returns the value of thefilterMask
record component.- Returns:
- the value of the
filterMask
record component
-
msgTypeId
public int msgTypeId()Returns the value of themsgTypeId
record component.- Returns:
- the value of the
msgTypeId
record component
-
msgTypeName
Returns the value of themsgTypeName
record component.- Returns:
- the value of the
msgTypeName
record component
-
msgTypeTarget
Returns the value of themsgTypeTarget
record component.- Returns:
- the value of the
msgTypeTarget
record component
-