Package net.minecraft.network.encryption
Record Class SignedChatMessage
java.lang.Object
java.lang.Record
net.minecraft.network.encryption.SignedChatMessage
- Record Components:
signedContent-signature-unsignedContent-
public record SignedChatMessage(Text signedContent, ChatMessageSignature signature, Optional<Text> unsignedContent)
extends Record
A signed chat message, consisting of the signature, the signed content,
and the optional unsigned content supplied when the chat decorator produced
unsigned message due to the chat preview being disabled on either side.
Note that the signature itself might not be valid.
- Mappings:
Namespace Name official ruintermediary net/minecraft/class_7471named net/minecraft/network/encryption/SignedChatMessageofficial aintermediary comp_804named signedContentofficial bintermediary comp_805named signatureofficial cintermediary comp_830named unsignedContent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChatMessageSignatureThe field for thesignaturerecord component.private final TextThe field for thesignedContentrecord component.The field for theunsignedContentrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSignedChatMessage(Text text, ChatMessageSignature chatMessageSignature, Optional<Text> optional) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the content of the message.final inthashCode()Returns a hash code value for this object.booleanmethod_44310(ServerPlayerEntity serverPlayerEntity) static Message<SignedChatMessage>method_44311(Message<Text> message, Message<Text> message2, ChatMessageSignature chatMessageSignature, boolean bool) booleanmethod_44312(ServerCommandSource serverCommandSource) static SignedChatMessagemethod_44313(Text text, Text text2, ChatMessageSignature chatMessageSignature, boolean bool) static SignedChatMessageof(String signedContent, ChatMessageSignature signature) Returns a new signed chat message withsignedContentandsignature.static SignedChatMessageReturns a new signed chat message withsignedContentand "none" signature.static SignedChatMessageof(Text signedContent, ChatMessageSignature signature) Returns a new signed chat message withsignedContentandsignature.Returns the value of thesignaturerecord component.Returns the value of thesignedContentrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theunsignedContentrecord component.booleanverify(PlayerPublicKey key) Returns whether the message can be verified using the public key.withUnsigned(Text unsignedContent) Returns the new signed chat message withunsignedContentadded.
-
Field Details
-
signedContent
The field for thesignedContentrecord component. -
signature
The field for thesignaturerecord component. -
unsignedContent
The field for theunsignedContentrecord component.
-
-
Constructor Details
-
SignedChatMessage
public SignedChatMessage(Text text, ChatMessageSignature chatMessageSignature, Optional<Text> optional)
-
-
Method Details
-
of
Returns a new signed chat message withsignedContentandsignature.- Returns:
- a new signed chat message with
signedContentandsignature - Mappings:
Namespace Name Mixin selector official aLru;a(Lrm;Lrr;)Lru;intermediary method_44128Lnet/minecraft/class_7471;method_44128(Lnet/minecraft/class_2561;Lnet/minecraft/class_7469;)Lnet/minecraft/class_7471;named ofLnet/minecraft/network/encryption/SignedChatMessage;of(Lnet/minecraft/text/Text;Lnet/minecraft/network/encryption/ChatMessageSignature;)Lnet/minecraft/network/encryption/SignedChatMessage;
-
of
Returns a new signed chat message withsignedContentandsignature.- Returns:
- a new signed chat message with
signedContentandsignature - Mappings:
Namespace Name Mixin selector official aLru;a(Ljava/lang/String;Lrr;)Lru;intermediary method_44126Lnet/minecraft/class_7471;method_44126(Ljava/lang/String;Lnet/minecraft/class_7469;)Lnet/minecraft/class_7471;named ofLnet/minecraft/network/encryption/SignedChatMessage;of(Ljava/lang/String;Lnet/minecraft/network/encryption/ChatMessageSignature;)Lnet/minecraft/network/encryption/SignedChatMessage;
-
method_44313
public static SignedChatMessage method_44313(Text text, Text text2, ChatMessageSignature chatMessageSignature, boolean bool) - Mappings:
Namespace Name Mixin selector official aLru;a(Lrm;Lrm;Lrr;Z)Lru;intermediary method_44313Lnet/minecraft/class_7471;method_44313(Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;Lnet/minecraft/class_7469;Z)Lnet/minecraft/class_7471;named method_44313Lnet/minecraft/network/encryption/SignedChatMessage;method_44313(Lnet/minecraft/text/Text;Lnet/minecraft/text/Text;Lnet/minecraft/network/encryption/ChatMessageSignature;Z)Lnet/minecraft/network/encryption/SignedChatMessage;
-
method_44311
public static Message<SignedChatMessage> method_44311(Message<Text> message, Message<Text> message2, ChatMessageSignature chatMessageSignature, boolean bool) - Mappings:
Namespace Name Mixin selector official aLru;a(Lagd;Lagd;Lrr;Z)Lagd;intermediary method_44311Lnet/minecraft/class_7471;method_44311(Lnet/minecraft/class_5837;Lnet/minecraft/class_5837;Lnet/minecraft/class_7469;Z)Lnet/minecraft/class_5837;named method_44311Lnet/minecraft/network/encryption/SignedChatMessage;method_44311(Lnet/minecraft/server/filter/Message;Lnet/minecraft/server/filter/Message;Lnet/minecraft/network/encryption/ChatMessageSignature;Z)Lnet/minecraft/server/filter/Message;
-
of
Returns a new signed chat message withsignedContentand "none" signature.- Returns:
- a new signed chat message with
signedContentand "none" signature - Mappings:
Namespace Name Mixin selector official aLru;a(Lrm;)Lru;intermediary method_44127Lnet/minecraft/class_7471;method_44127(Lnet/minecraft/class_2561;)Lnet/minecraft/class_7471;named ofLnet/minecraft/network/encryption/SignedChatMessage;of(Lnet/minecraft/text/Text;)Lnet/minecraft/network/encryption/SignedChatMessage;
-
withUnsigned
Returns the new signed chat message withunsignedContentadded.- Returns:
- the new signed chat message with
unsignedContentadded - API Note:
- This is used in vanilla when chat decorator decorates the message without the client previewing it. In this case, the undecorated content is signed but the decorated content is unsigned.
- Mappings:
Namespace Name Mixin selector official bLru;b(Lrm;)Lru;intermediary method_44129Lnet/minecraft/class_7471;method_44129(Lnet/minecraft/class_2561;)Lnet/minecraft/class_7471;named withUnsignedLnet/minecraft/network/encryption/SignedChatMessage;withUnsigned(Lnet/minecraft/text/Text;)Lnet/minecraft/network/encryption/SignedChatMessage;
-
verify
Returns whether the message can be verified using the public key.- Returns:
- whether the message can be verified using the public key
- Mappings:
Namespace Name Mixin selector official aLru;a(Lbtg;)Zintermediary method_43867Lnet/minecraft/class_7471;method_43867(Lnet/minecraft/class_7428;)Znamed verifyLnet/minecraft/network/encryption/SignedChatMessage;verify(Lnet/minecraft/network/encryption/PlayerPublicKey;)Z
-
method_44310
- Mappings:
Namespace Name Mixin selector official aLru;a(Lafp;)Zintermediary method_44310Lnet/minecraft/class_7471;method_44310(Lnet/minecraft/class_3222;)Znamed method_44310Lnet/minecraft/network/encryption/SignedChatMessage;method_44310(Lnet/minecraft/server/network/ServerPlayerEntity;)Z
-
method_44312
- Mappings:
Namespace Name Mixin selector official aLru;a(Ldr;)Zintermediary method_44312Lnet/minecraft/class_7471;method_44312(Lnet/minecraft/class_2168;)Znamed method_44312Lnet/minecraft/network/encryption/SignedChatMessage;method_44312(Lnet/minecraft/server/command/ServerCommandSource;)Z
-
getContent
Returns the content of the message.This returns the unsigned content if present, and fallbacks to the signed content.
- Returns:
- the content of the message
- Mappings:
Namespace Name Mixin selector official aLru;a()Lrm;intermediary method_44125Lnet/minecraft/class_7471;method_44125()Lnet/minecraft/class_2561;named getContentLnet/minecraft/network/encryption/SignedChatMessage;getContent()Lnet/minecraft/text/Text;
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
signedContent
Returns the value of thesignedContentrecord component.- Returns:
- the value of the
signedContentrecord component
-
signature
Returns the value of thesignaturerecord component.- Returns:
- the value of the
signaturerecord component
-
unsignedContent
Returns the value of theunsignedContentrecord component.- Returns:
- the value of the
unsignedContentrecord component
-