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 ru
intermediary net/minecraft/class_7471
named net/minecraft/network/message/SignedMessage
official a
intermediary comp_804
named signedContent
official b
intermediary comp_805
named signature
official c
intermediary comp_830
named unsignedContent
-
Field Summary
Modifier and TypeFieldDescriptionprivate final MessageSignature
The field for thesignature
record component.private final Text
The field for thesignedContent
record component.The field for theunsignedContent
record component. -
Constructor Summary
ConstructorDescriptionSignedMessage
(Text text, MessageSignature messageSignature, Optional<Text> optional) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the content of the message.final int
hashCode()
Returns a hash code value for this object.static SignedMessage
of
(String signedContent, MessageSignature signature) Returns a new signed chat message withsignedContent
andsignature
.static SignedMessage
Returns a new signed chat message withsignedContent
and "none" signature.static SignedMessage
of
(Text signedContent, MessageSignature signature) Returns a new signed chat message withsignedContent
andsignature
.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 the value of thesignature
record component.Returns the value of thesignedContent
record component.static FilteredMessage<SignedMessage>
toSignedMessage
(FilteredMessage<Text> original, FilteredMessage<Text> decorated, MessageSignature signature, boolean preview) final String
toString()
Returns a string representation of this record class.Returns the value of theunsignedContent
record component.boolean
verify
(PlayerPublicKey key) Returns whether the message can be verified using the public key.boolean
verify
(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.boolean
verify
(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 withunsignedContent
added.
-
Field Details
-
signedContent
The field for thesignedContent
record component. -
signature
The field for thesignature
record component. -
unsignedContent
The field for theunsignedContent
record component.
-
-
Constructor Details
-
SignedMessage
-
-
Method Details
-
of
Returns a new signed chat message withsignedContent
andsignature
.- Returns:
- a new signed chat message with
signedContent
andsignature
- Mappings:
Namespace Name Mixin selector official a
Lru;a(Lrm;Lrr;)Lru;
intermediary method_44128
Lnet/minecraft/class_7471;method_44128(Lnet/minecraft/class_2561;Lnet/minecraft/class_7469;)Lnet/minecraft/class_7471;
named of
Lnet/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 withsignedContent
andsignature
.- Returns:
- a new signed chat message with
signedContent
andsignature
- Mappings:
Namespace Name Mixin selector official a
Lru;a(Ljava/lang/String;Lrr;)Lru;
intermediary method_44126
Lnet/minecraft/class_7471;method_44126(Ljava/lang/String;Lnet/minecraft/class_7469;)Lnet/minecraft/class_7471;
named of
Lnet/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 a
Lru;a(Lrm;Lrm;Lrr;Z)Lru;
intermediary method_44313
Lnet/minecraft/class_7471;method_44313(Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;Lnet/minecraft/class_7469;Z)Lnet/minecraft/class_7471;
named of
Lnet/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 a
Lru;a(Lagd;Lagd;Lrr;Z)Lagd;
intermediary method_44311
Lnet/minecraft/class_7471;method_44311(Lnet/minecraft/class_5837;Lnet/minecraft/class_5837;Lnet/minecraft/class_7469;Z)Lnet/minecraft/class_5837;
named toSignedMessage
Lnet/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 withsignedContent
and "none" signature.- Returns:
- a new signed chat message with
signedContent
and "none" signature - Mappings:
Namespace Name Mixin selector official a
Lru;a(Lrm;)Lru;
intermediary method_44127
Lnet/minecraft/class_7471;method_44127(Lnet/minecraft/class_2561;)Lnet/minecraft/class_7471;
named of
Lnet/minecraft/network/message/SignedMessage;of(Lnet/minecraft/text/Text;)Lnet/minecraft/network/message/SignedMessage;
-
withUnsigned
Returns the new signed chat message withunsignedContent
added.- Returns:
- the new signed chat message with
unsignedContent
added - 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 b
Lru;b(Lrm;)Lru;
intermediary method_44129
Lnet/minecraft/class_7471;method_44129(Lnet/minecraft/class_2561;)Lnet/minecraft/class_7471;
named withUnsigned
Lnet/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 a
Lru;a(Lbti;)Z
intermediary method_43867
Lnet/minecraft/class_7471;method_43867(Lnet/minecraft/class_7428;)Z
named verify
Lnet/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 a
Lru;a(Lafp;)Z
intermediary method_44310
Lnet/minecraft/class_7471;method_44310(Lnet/minecraft/class_3222;)Z
named verify
Lnet/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 a
Lru;a(Ldr;)Z
intermediary method_44312
Lnet/minecraft/class_7471;method_44312(Lnet/minecraft/class_2168;)Z
named verify
Lnet/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 a
Lru;a()Lrm;
intermediary method_44125
Lnet/minecraft/class_7471;method_44125()Lnet/minecraft/class_2561;
named getContent
Lnet/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 thesignedContent
record component.- Returns:
- the value of the
signedContent
record component
-
signature
Returns the value of thesignature
record component.- Returns:
- the value of the
signature
record component
-
unsignedContent
Returns the value of theunsignedContent
record component.- Returns:
- the value of the
unsignedContent
record component
-