Package net.minecraft.network.message
Record Class SignedMessage
java.lang.Object
java.lang.Record
net.minecraft.network.message.SignedMessage
- Record Components:
signedContent-signature-unsignedContent-
public record SignedMessage(Text signedContent, MessageSignature signature, Optional<Text> unsignedContent)
extends Record
A signed 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/message/SignedMessageofficial aintermediary comp_804named signedContentofficial bintermediary comp_805named signatureofficial cintermediary comp_830named unsignedContent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MessageSignatureThe field for thesignaturerecord component.private final TextThe field for thesignedContentrecord component.The field for theunsignedContentrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSignedMessage(Text text, MessageSignature messageSignature, 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.static SignedMessageof(String signedContent, MessageSignature signature) Returns a new signed chat message withsignedContentandsignature.static SignedMessageReturns a new signed chat message withsignedContentand "none" signature.static SignedMessageof(Text signedContent, MessageSignature signature) Returns a new signed chat message withsignedContentandsignature.static SignedMessageof(Text originalContent, Text decoratedContent, MessageSignature signature, boolean previewed) Returns a new signed chat message from the content supplied by the chat decorator.Returns the value of thesignaturerecord component.Returns the value of thesignedContentrecord component.static FilteredMessage<SignedMessage>toSignedMessage(FilteredMessage<Text> original, FilteredMessage<Text> decorated, MessageSignature signature, boolean preview) 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.booleanverify(ServerCommandSource source) Returns whether the message can be verified using the public key of the source or if the source does not have the key.booleanverify(ServerPlayerEntity player) Returns whether the message can be verified using the public key or if the player does not have the 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
-
SignedMessage
-
-
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/message/SignedMessage;of(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignature;)Lnet/minecraft/network/message/SignedMessage;
-
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/message/SignedMessage;of(Ljava/lang/String;Lnet/minecraft/network/message/MessageSignature;)Lnet/minecraft/network/message/SignedMessage;
-
of
public static SignedMessage of(Text originalContent, Text decoratedContent, MessageSignature signature, boolean previewed) Returns a new signed chat message from the content supplied by the chat decorator.- Returns:
- a new signed chat message from the content supplied by the chat decorator
- Implementation Note:
- If the decorated content is different from the original and is not previewed, this will create a signed chat message with the signed original content and the unsigned decorated content. Otherwise, this will create a signed chat message with the signed decorated content.
- 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 ofLnet/minecraft/network/message/SignedMessage;of(Lnet/minecraft/text/Text;Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignature;Z)Lnet/minecraft/network/message/SignedMessage;
-
toSignedMessage
public static FilteredMessage<SignedMessage> toSignedMessage(FilteredMessage<Text> original, FilteredMessage<Text> decorated, MessageSignature signature, boolean preview) - 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 toSignedMessageLnet/minecraft/network/message/SignedMessage;toSignedMessage(Lnet/minecraft/server/filter/FilteredMessage;Lnet/minecraft/server/filter/FilteredMessage;Lnet/minecraft/network/message/MessageSignature;Z)Lnet/minecraft/server/filter/FilteredMessage;
-
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/message/SignedMessage;of(Lnet/minecraft/text/Text;)Lnet/minecraft/network/message/SignedMessage;
-
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/message/SignedMessage;withUnsigned(Lnet/minecraft/text/Text;)Lnet/minecraft/network/message/SignedMessage;
-
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(Lbti;)Zintermediary method_43867Lnet/minecraft/class_7471;method_43867(Lnet/minecraft/class_7428;)Znamed verifyLnet/minecraft/network/message/SignedMessage;verify(Lnet/minecraft/network/encryption/PlayerPublicKey;)Z
-
verify
Returns whether the message can be verified using the public key or if the player does not have the key.- Returns:
- whether the message can be verified using the public key or if the player does not have the key
- Mappings:
Namespace Name Mixin selector official aLru;a(Lafp;)Zintermediary method_44310Lnet/minecraft/class_7471;method_44310(Lnet/minecraft/class_3222;)Znamed verifyLnet/minecraft/network/message/SignedMessage;verify(Lnet/minecraft/server/network/ServerPlayerEntity;)Z
-
verify
Returns whether the message can be verified using the public key of the source or if the source does not have the key.- Returns:
- whether the message can be verified using the public key of the source or if the source does not have the key
- Mappings:
Namespace Name Mixin selector official aLru;a(Ldr;)Zintermediary method_44312Lnet/minecraft/class_7471;method_44312(Lnet/minecraft/class_2168;)Znamed verifyLnet/minecraft/network/message/SignedMessage;verify(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/message/SignedMessage;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
-