Package net.minecraft.network.message
Record Class SignedMessage
java.lang.Object
java.lang.Record
net.minecraft.network.message.SignedMessage
- Record Components:
signedHeader-headerSignature-signedBody-unsignedContent-filterMask-
public record SignedMessage(MessageHeader signedHeader, MessageSignatureData headerSignature, MessageBody signedBody, Optional<Text> unsignedContent, FilterMask filterMask)
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 sdintermediary net/minecraft/class_7471named net/minecraft/network/message/SignedMessageofficial cintermediary comp_926named signedHeaderofficial dintermediary comp_927named headerSignatureofficial eintermediary comp_928named signedBodyofficial fintermediary comp_830named unsignedContentofficial gintermediary comp_981named filterMask
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Durationprivate final FilterMaskThe field for thefilterMaskrecord component.private final MessageSignatureDataThe field for theheaderSignaturerecord component.static final Durationprivate final MessageBodyThe field for thesignedBodyrecord component.private final MessageHeaderThe field for thesignedHeaderrecord component.The field for theunsignedContentrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSignedMessage(MessageHeader messageHeader, MessageSignatureData messageSignatureData, MessageBody messageBody, Optional<Text> optional, FilterMask filterMask) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanVerifyFrom(UUID sender) Returns whether the message can be verified as fromsender.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefilterMaskrecord component.Returns the content of the message.longgetSalt()final inthashCode()Returns a hash code value for this object.Returns the value of theheaderSignaturerecord component.booleanisExpiredOnClient(Instant currentTime) booleanisExpiredOnServer(Instant currentTime) booleanstatic SignedMessageofUnsigned(DecoratedContents content) Returns a new signed message with empty signature.static SignedMessageofUnsigned(MessageMetadata metadata, DecoratedContents content) Returns a new signed message with given metadata and empty signature.Returns the value of thesignedBodyrecord component.Returns the value of thesignedHeaderrecord 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.booleanverify(SignatureVerifier verifier) booleanverify(MessageSourceProfile profile) Returns whether the message can be verified using the public key or if the player does not have the key.withFilterMask(FilterMask filterMask) Returns the signed chat message withfilterMaskadded.withFilterMaskEnabled(boolean enabled) Returns this signed chat message ifenabledistrue, otherwise a new signed chat message without filtered parts.Returns the signed chat message withunsignedContentremoved if it exists.withUnsignedContent(Text unsignedContent) voidwrite(PacketByteBuf buf)
-
Field Details
-
signedHeader
The field for thesignedHeaderrecord component. -
headerSignature
The field for theheaderSignaturerecord component. -
signedBody
The field for thesignedBodyrecord component. -
unsignedContent
The field for theunsignedContentrecord component. -
filterMask
The field for thefilterMaskrecord component. -
SERVERBOUND_TIME_TO_LIVE
- Mappings:
Namespace Name Mixin selector official aLsd;a:Ljava/time/Duration;intermediary field_39786Lnet/minecraft/class_7471;field_39786:Ljava/time/Duration;named SERVERBOUND_TIME_TO_LIVELnet/minecraft/network/message/SignedMessage;SERVERBOUND_TIME_TO_LIVE:Ljava/time/Duration;
-
CLIENTBOUND_TIME_TO_LIVE
- Mappings:
Namespace Name Mixin selector official bLsd;b:Ljava/time/Duration;intermediary field_39787Lnet/minecraft/class_7471;field_39787:Ljava/time/Duration;named CLIENTBOUND_TIME_TO_LIVELnet/minecraft/network/message/SignedMessage;CLIENTBOUND_TIME_TO_LIVE:Ljava/time/Duration;
-
-
Constructor Details
-
SignedMessage
- Mappings:
Namespace Name Mixin selector official <init>Lsd;<init>(Lqx;)Vintermediary <init>Lnet/minecraft/class_7471;<init>(Lnet/minecraft/class_2540;)Vnamed <init>Lnet/minecraft/network/message/SignedMessage;<init>(Lnet/minecraft/network/PacketByteBuf;)V
-
SignedMessage
public SignedMessage(MessageHeader messageHeader, MessageSignatureData messageSignatureData, MessageBody messageBody, Optional<Text> optional, FilterMask filterMask)
-
-
Method Details
-
ofUnsigned
Returns a new signed message with empty signature.- Returns:
- a new signed message with empty signature
- Mappings:
Namespace Name Mixin selector official aLsd;a(Lri;)Lsd;intermediary method_45041Lnet/minecraft/class_7471;method_45041(Lnet/minecraft/class_7634;)Lnet/minecraft/class_7471;named ofUnsignedLnet/minecraft/network/message/SignedMessage;ofUnsigned(Lnet/minecraft/network/message/DecoratedContents;)Lnet/minecraft/network/message/SignedMessage;
-
ofUnsigned
Returns a new signed message with given metadata and empty signature.- Returns:
- a new signed message with given metadata and empty signature
- Mappings:
Namespace Name Mixin selector official aLsd;a(Lsa;Lri;)Lsd;intermediary method_45098Lnet/minecraft/class_7471;method_45098(Lnet/minecraft/class_7470;Lnet/minecraft/class_7634;)Lnet/minecraft/class_7471;named ofUnsignedLnet/minecraft/network/message/SignedMessage;ofUnsigned(Lnet/minecraft/network/message/MessageMetadata;Lnet/minecraft/network/message/DecoratedContents;)Lnet/minecraft/network/message/SignedMessage;
-
write
- Mappings:
Namespace Name Mixin selector official aLsd;a(Lqx;)Vintermediary method_44859Lnet/minecraft/class_7471;method_44859(Lnet/minecraft/class_2540;)Vnamed writeLnet/minecraft/network/message/SignedMessage;write(Lnet/minecraft/network/PacketByteBuf;)V
-
withUnsignedContent
- Mappings:
Namespace Name Mixin selector official aLsd;a(Lrq;)Lsd;intermediary method_44863Lnet/minecraft/class_7471;method_44863(Lnet/minecraft/class_2561;)Lnet/minecraft/class_7471;named withUnsignedContentLnet/minecraft/network/message/SignedMessage;withUnsignedContent(Lnet/minecraft/text/Text;)Lnet/minecraft/network/message/SignedMessage;
-
withoutUnsigned
Returns the signed chat message withunsignedContentremoved if it exists.- Returns:
- the signed chat message with
unsignedContentremoved if it exists - Implementation Note:
- This returns itself if the message does not have an unsigned content.
- Mappings:
Namespace Name Mixin selector official aLsd;a()Lsd;intermediary method_44607Lnet/minecraft/class_7471;method_44607()Lnet/minecraft/class_7471;named withoutUnsignedLnet/minecraft/network/message/SignedMessage;withoutUnsigned()Lnet/minecraft/network/message/SignedMessage;
-
withFilterMask
Returns the signed chat message withfilterMaskadded.- Returns:
- the signed chat message with
filterMaskadded - Mappings:
Namespace Name Mixin selector official aLsd;a(Lrt;)Lsd;intermediary method_45097Lnet/minecraft/class_7471;method_45097(Lnet/minecraft/class_7649;)Lnet/minecraft/class_7471;named withFilterMaskLnet/minecraft/network/message/SignedMessage;withFilterMask(Lnet/minecraft/network/message/FilterMask;)Lnet/minecraft/network/message/SignedMessage;
-
withFilterMaskEnabled
Returns this signed chat message ifenabledistrue, otherwise a new signed chat message without filtered parts.- Returns:
- this signed chat message if
enabledistrue, otherwise a new signed chat message without filtered parts - Mappings:
Namespace Name Mixin selector official aLsd;a(Z)Lsd;intermediary method_45099Lnet/minecraft/class_7471;method_45099(Z)Lnet/minecraft/class_7471;named withFilterMaskEnabledLnet/minecraft/network/message/SignedMessage;withFilterMaskEnabled(Z)Lnet/minecraft/network/message/SignedMessage;
-
verify
- Mappings:
Namespace Name Mixin selector official aLsd;a(Lamp;)Zintermediary method_44858Lnet/minecraft/class_7471;method_44858(Lnet/minecraft/class_7500;)Znamed verifyLnet/minecraft/network/message/SignedMessage;verify(Lnet/minecraft/network/encryption/SignatureVerifier;)Z
-
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 aLsd;a(Lbuf;)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 aLsd;a(Lrl;)Zintermediary method_44310Lnet/minecraft/class_7471;method_44310(Lnet/minecraft/class_7436;)Znamed verifyLnet/minecraft/network/message/SignedMessage;verify(Lnet/minecraft/network/message/MessageSourceProfile;)Z
-
getSignedContent
- Mappings:
Namespace Name Mixin selector official bLsd;b()Lri;intermediary method_44862Lnet/minecraft/class_7471;method_44862()Lnet/minecraft/class_7634;named getSignedContentLnet/minecraft/network/message/SignedMessage;getSignedContent()Lnet/minecraft/network/message/DecoratedContents;
-
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 cLsd;c()Lrq;intermediary method_44125Lnet/minecraft/class_7471;method_44125()Lnet/minecraft/class_2561;named getContentLnet/minecraft/network/message/SignedMessage;getContent()Lnet/minecraft/text/Text;
-
getTimestamp
- Mappings:
Namespace Name Mixin selector official dLsd;d()Ljava/time/Instant;intermediary method_44864Lnet/minecraft/class_7471;method_44864()Ljava/time/Instant;named getTimestampLnet/minecraft/network/message/SignedMessage;getTimestamp()Ljava/time/Instant;
-
getSalt
public long getSalt()- Mappings:
Namespace Name Mixin selector official eLsd;e()Jintermediary method_44865Lnet/minecraft/class_7471;method_44865()Jnamed getSaltLnet/minecraft/network/message/SignedMessage;getSalt()J
-
isExpiredOnServer
- Mappings:
Namespace Name Mixin selector official aLsd;a(Ljava/time/Instant;)Zintermediary method_44747Lnet/minecraft/class_7471;method_44747(Ljava/time/Instant;)Znamed isExpiredOnServerLnet/minecraft/network/message/SignedMessage;isExpiredOnServer(Ljava/time/Instant;)Z
-
isExpiredOnClient
- Mappings:
Namespace Name Mixin selector official bLsd;b(Ljava/time/Instant;)Zintermediary method_44748Lnet/minecraft/class_7471;method_44748(Ljava/time/Instant;)Znamed isExpiredOnClientLnet/minecraft/network/message/SignedMessage;isExpiredOnClient(Ljava/time/Instant;)Z
-
createMetadata
- Mappings:
Namespace Name Mixin selector official fLsd;f()Lsa;intermediary method_44866Lnet/minecraft/class_7471;method_44866()Lnet/minecraft/class_7470;named createMetadataLnet/minecraft/network/message/SignedMessage;createMetadata()Lnet/minecraft/network/message/MessageMetadata;
-
toLastSeenMessageEntry
- Mappings:
Namespace Name Mixin selector official gLsd;g()Lrw$a;intermediary method_44995Lnet/minecraft/class_7471;method_44995()Lnet/minecraft/class_7635$class_7609;named toLastSeenMessageEntryLnet/minecraft/network/message/SignedMessage;toLastSeenMessageEntry()Lnet/minecraft/network/message/LastSeenMessageList$Entry;
-
canVerifyFrom
Returns whether the message can be verified as fromsender.This does not actually verify that the message is, in fact, from
sender. Rather, this returns whether it's possible to verify thatsendersent this message.- Returns:
- whether the message can be verified as from
sender - Mappings:
Namespace Name Mixin selector official aLsd;a(Ljava/util/UUID;)Zintermediary method_45040Lnet/minecraft/class_7471;method_45040(Ljava/util/UUID;)Znamed canVerifyFromLnet/minecraft/network/message/SignedMessage;canVerifyFrom(Ljava/util/UUID;)Z
-
isFullyFiltered
public boolean isFullyFiltered()- Mappings:
Namespace Name Mixin selector official hLsd;h()Zintermediary method_45100Lnet/minecraft/class_7471;method_45100()Znamed isFullyFilteredLnet/minecraft/network/message/SignedMessage;isFullyFiltered()Z
-
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). -
signedHeader
Returns the value of thesignedHeaderrecord component.- Returns:
- the value of the
signedHeaderrecord component
-
headerSignature
Returns the value of theheaderSignaturerecord component.- Returns:
- the value of the
headerSignaturerecord component
-
signedBody
Returns the value of thesignedBodyrecord component.- Returns:
- the value of the
signedBodyrecord component
-
unsignedContent
Returns the value of theunsignedContentrecord component.- Returns:
- the value of the
unsignedContentrecord component
-
filterMask
Returns the value of thefilterMaskrecord component.- Returns:
- the value of the
filterMaskrecord component
-