Record Class ChatMessageC2SPacket
- Record Components:
chatMessage-timestamp-salt-createSignatureInstance-previewed-
- All Implemented Interfaces:
Packet<ServerPlayPacketListener>
This truncates the message to at most 256 characters before sending to the server on the client. If the server receives the message longer than 256 characters, it will reject the message and disconnect the client.
If the message contains an invalid character (see isValidChar) or if the server
receives the messages in improper order. the server will
reject the message and disconnect the client.
Messages that took more than
invalid @link
SignedMessage#SERVERBOUND_TIME_TO_LIVEinvalid @link
SignedMessage#CLIENTBOUND_TIME_TO_LIVE
- See Also:
- Mappings:
Namespace Name official xjintermediary net/minecraft/class_2797named net/minecraft/network/packet/c2s/play/ChatMessageC2SPacketofficial aintermediary comp_945named chatMessageofficial bintermediary comp_946named timestampofficial cintermediary comp_947named saltofficial dintermediary comp_948named createSignatureInstanceofficial eintermediary comp_949named previewed
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thechatMessagerecord component.private final MessageSignatureThe field for thecreateSignatureInstancerecord component.private final booleanThe field for thepreviewedrecord component.private final longThe field for thesaltrecord component.private final InstantThe field for thetimestamprecord component. -
Constructor Summary
ConstructorsConstructorDescriptionChatMessageC2SPacket(String chatMessage, Instant instant, long long2, MessageSignature messageSignature, boolean bool) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ServerPlayPacketListener serverPlayPacketListener) Returns the value of thechatMessagerecord component.Returns the value of thecreateSignatureInstancerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.method_44892(ServerPlayerEntity serverPlayerEntity) booleanReturns whether the chat message was previewed before sending.longsalt()Returns the value of thesaltrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.voidwrite(PacketByteBuf buf) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.Packet
isWritingErrorSkippable
-
Field Details
-
chatMessage
The field for thechatMessagerecord component. -
timestamp
The field for thetimestamprecord component. -
salt
private final long saltThe field for thesaltrecord component. -
createSignatureInstance
The field for thecreateSignatureInstancerecord component. -
previewed
private final boolean previewedThe field for thepreviewedrecord component.
-
-
Constructor Details
-
ChatMessageC2SPacket
public ChatMessageC2SPacket(String chatMessage, Instant instant, long long2, MessageSignature messageSignature, boolean bool) - Mappings:
Namespace Name Mixin selector official <init>Lxj;<init>(Ljava/lang/String;Ljava/time/Instant;JLrr;Z)Vintermediary <init>Lnet/minecraft/class_2797;<init>(Ljava/lang/String;Ljava/time/Instant;JLnet/minecraft/class_7469;Z)Vnamed <init>Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;<init>(Ljava/lang/String;Ljava/time/Instant;JLnet/minecraft/network/message/MessageSignature;Z)V
-
ChatMessageC2SPacket
- Mappings:
Namespace Name Mixin selector official <init>Lxj;<init>(Lqx;)Vintermediary <init>Lnet/minecraft/class_2797;<init>(Lnet/minecraft/class_2540;)Vnamed <init>Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;<init>(Lnet/minecraft/network/PacketByteBuf;)V
-
-
Method Details
-
write
- Specified by:
writein interfacePacket<ServerPlayPacketListener>- Mappings:
Namespace Name Mixin selector official aLst;a(Lqx;)Vintermediary method_11052Lnet/minecraft/class_2596;method_11052(Lnet/minecraft/class_2540;)Vnamed writeLnet/minecraft/network/Packet;write(Lnet/minecraft/network/PacketByteBuf;)V
-
apply
- Specified by:
applyin interfacePacket<ServerPlayPacketListener>- Mappings:
Namespace Name Mixin selector official aLxj;a(Lxd;)Vintermediary method_12115Lnet/minecraft/class_2797;method_12115(Lnet/minecraft/class_2792;)Vnamed applyLnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;apply(Lnet/minecraft/network/listener/ServerPlayPacketListener;)V
-
method_44892
- Mappings:
Namespace Name Mixin selector official aLxj;a(Lafx;)Lrs;intermediary method_44892Lnet/minecraft/class_2797;method_44892(Lnet/minecraft/class_3222;)Lnet/minecraft/class_7470;named method_44892Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;method_44892(Lnet/minecraft/server/network/ServerPlayerEntity;)Lnet/minecraft/network/message/ChatMessageSigner;
-
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 '=='. -
chatMessage
Returns the value of thechatMessagerecord component.- Returns:
- the value of the
chatMessagerecord 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
-
createSignatureInstance
Returns the value of thecreateSignatureInstancerecord component.- Returns:
- the value of the
createSignatureInstancerecord component
-
previewed
public boolean previewed()Returns whether the chat message was previewed before sending.- Returns:
- whether the chat message was previewed before sending
- API Note:
- Chat decorators can produce signed decorated content only if it was previewed.
- Mappings:
Namespace Name Mixin selector official fLxj;f()Zintermediary comp_949Lnet/minecraft/class_2797;comp_949()Znamed previewedLnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;previewed()Z
-