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 sd
intermediary net/minecraft/class_7471
named net/minecraft/network/message/SignedMessage
official c
intermediary comp_926
named signedHeader
official d
intermediary comp_927
named headerSignature
official e
intermediary comp_928
named signedBody
official f
intermediary comp_830
named unsignedContent
official g
intermediary comp_981
named filterMask
  • Field Details

    • signedHeader

      private final MessageHeader signedHeader
      The field for the signedHeader record component.
    • headerSignature

      private final MessageSignatureData headerSignature
      The field for the headerSignature record component.
    • signedBody

      private final MessageBody signedBody
      The field for the signedBody record component.
    • unsignedContent

      private final Optional<Text> unsignedContent
      The field for the unsignedContent record component.
    • filterMask

      private final FilterMask filterMask
      The field for the filterMask record component.
    • SERVERBOUND_TIME_TO_LIVE

      public static final Duration SERVERBOUND_TIME_TO_LIVE
      Mappings:
      Namespace Name Mixin selector
      official a Lsd;a:Ljava/time/Duration;
      intermediary field_39786 Lnet/minecraft/class_7471;field_39786:Ljava/time/Duration;
      named SERVERBOUND_TIME_TO_LIVE Lnet/minecraft/network/message/SignedMessage;SERVERBOUND_TIME_TO_LIVE:Ljava/time/Duration;
    • CLIENTBOUND_TIME_TO_LIVE

      public static final Duration CLIENTBOUND_TIME_TO_LIVE
      Mappings:
      Namespace Name Mixin selector
      official b Lsd;b:Ljava/time/Duration;
      intermediary field_39787 Lnet/minecraft/class_7471;field_39787:Ljava/time/Duration;
      named CLIENTBOUND_TIME_TO_LIVE Lnet/minecraft/network/message/SignedMessage;CLIENTBOUND_TIME_TO_LIVE:Ljava/time/Duration;
  • Constructor Details

    • SignedMessage

      public SignedMessage(PacketByteBuf buf)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lsd;<init>(Lqx;)V
      intermediary <init> Lnet/minecraft/class_7471;<init>(Lnet/minecraft/class_2540;)V
      named <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

      public static SignedMessage ofUnsigned(DecoratedContents content)
      Returns a new signed message with empty signature.
      Returns:
      a new signed message with empty signature
      Mappings:
      Namespace Name Mixin selector
      official a Lsd;a(Lri;)Lsd;
      intermediary method_45041 Lnet/minecraft/class_7471;method_45041(Lnet/minecraft/class_7634;)Lnet/minecraft/class_7471;
      named ofUnsigned Lnet/minecraft/network/message/SignedMessage;ofUnsigned(Lnet/minecraft/network/message/DecoratedContents;)Lnet/minecraft/network/message/SignedMessage;
    • ofUnsigned

      public static SignedMessage ofUnsigned(MessageMetadata metadata, DecoratedContents content)
      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 a Lsd;a(Lsa;Lri;)Lsd;
      intermediary method_45098 Lnet/minecraft/class_7471;method_45098(Lnet/minecraft/class_7470;Lnet/minecraft/class_7634;)Lnet/minecraft/class_7471;
      named ofUnsigned Lnet/minecraft/network/message/SignedMessage;ofUnsigned(Lnet/minecraft/network/message/MessageMetadata;Lnet/minecraft/network/message/DecoratedContents;)Lnet/minecraft/network/message/SignedMessage;
    • write

      public void write(PacketByteBuf buf)
      Mappings:
      Namespace Name Mixin selector
      official a Lsd;a(Lqx;)V
      intermediary method_44859 Lnet/minecraft/class_7471;method_44859(Lnet/minecraft/class_2540;)V
      named write Lnet/minecraft/network/message/SignedMessage;write(Lnet/minecraft/network/PacketByteBuf;)V
    • withUnsignedContent

      public SignedMessage withUnsignedContent(Text unsignedContent)
      Mappings:
      Namespace Name Mixin selector
      official a Lsd;a(Lrq;)Lsd;
      intermediary method_44863 Lnet/minecraft/class_7471;method_44863(Lnet/minecraft/class_2561;)Lnet/minecraft/class_7471;
      named withUnsignedContent Lnet/minecraft/network/message/SignedMessage;withUnsignedContent(Lnet/minecraft/text/Text;)Lnet/minecraft/network/message/SignedMessage;
    • withoutUnsigned

      public SignedMessage withoutUnsigned()
      Returns the signed chat message with unsignedContent removed if it exists.
      Returns:
      the signed chat message with unsignedContent removed if it exists
      Implementation Note:
      This returns itself if the message does not have an unsigned content.
      Mappings:
      Namespace Name Mixin selector
      official a Lsd;a()Lsd;
      intermediary method_44607 Lnet/minecraft/class_7471;method_44607()Lnet/minecraft/class_7471;
      named withoutUnsigned Lnet/minecraft/network/message/SignedMessage;withoutUnsigned()Lnet/minecraft/network/message/SignedMessage;
    • withFilterMask

      public SignedMessage withFilterMask(FilterMask filterMask)
      Returns the signed chat message with filterMask added.
      Returns:
      the signed chat message with filterMask added
      Mappings:
      Namespace Name Mixin selector
      official a Lsd;a(Lrt;)Lsd;
      intermediary method_45097 Lnet/minecraft/class_7471;method_45097(Lnet/minecraft/class_7649;)Lnet/minecraft/class_7471;
      named withFilterMask Lnet/minecraft/network/message/SignedMessage;withFilterMask(Lnet/minecraft/network/message/FilterMask;)Lnet/minecraft/network/message/SignedMessage;
    • withFilterMaskEnabled

      public SignedMessage withFilterMaskEnabled(boolean enabled)
      Returns this signed chat message if enabled is true, otherwise a new signed chat message without filtered parts.
      Returns:
      this signed chat message if enabled is true, otherwise a new signed chat message without filtered parts
      Mappings:
      Namespace Name Mixin selector
      official a Lsd;a(Z)Lsd;
      intermediary method_45099 Lnet/minecraft/class_7471;method_45099(Z)Lnet/minecraft/class_7471;
      named withFilterMaskEnabled Lnet/minecraft/network/message/SignedMessage;withFilterMaskEnabled(Z)Lnet/minecraft/network/message/SignedMessage;
    • verify

      public boolean verify(SignatureVerifier verifier)
      Mappings:
      Namespace Name Mixin selector
      official a Lsd;a(Lamp;)Z
      intermediary method_44858 Lnet/minecraft/class_7471;method_44858(Lnet/minecraft/class_7500;)Z
      named verify Lnet/minecraft/network/message/SignedMessage;verify(Lnet/minecraft/network/encryption/SignatureVerifier;)Z
    • verify

      public boolean verify(PlayerPublicKey key)
      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 Lsd;a(Lbuf;)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

      public boolean verify(MessageSourceProfile profile)
      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 Lsd;a(Lrl;)Z
      intermediary method_44310 Lnet/minecraft/class_7471;method_44310(Lnet/minecraft/class_7436;)Z
      named verify Lnet/minecraft/network/message/SignedMessage;verify(Lnet/minecraft/network/message/MessageSourceProfile;)Z
    • getSignedContent

      public DecoratedContents getSignedContent()
      Mappings:
      Namespace Name Mixin selector
      official b Lsd;b()Lri;
      intermediary method_44862 Lnet/minecraft/class_7471;method_44862()Lnet/minecraft/class_7634;
      named getSignedContent Lnet/minecraft/network/message/SignedMessage;getSignedContent()Lnet/minecraft/network/message/DecoratedContents;
    • getContent

      public Text 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 c Lsd;c()Lrq;
      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;
    • getTimestamp

      public Instant getTimestamp()
      Mappings:
      Namespace Name Mixin selector
      official d Lsd;d()Ljava/time/Instant;
      intermediary method_44864 Lnet/minecraft/class_7471;method_44864()Ljava/time/Instant;
      named getTimestamp Lnet/minecraft/network/message/SignedMessage;getTimestamp()Ljava/time/Instant;
    • getSalt

      public long getSalt()
      Mappings:
      Namespace Name Mixin selector
      official e Lsd;e()J
      intermediary method_44865 Lnet/minecraft/class_7471;method_44865()J
      named getSalt Lnet/minecraft/network/message/SignedMessage;getSalt()J
    • isExpiredOnServer

      public boolean isExpiredOnServer(Instant currentTime)
      Mappings:
      Namespace Name Mixin selector
      official a Lsd;a(Ljava/time/Instant;)Z
      intermediary method_44747 Lnet/minecraft/class_7471;method_44747(Ljava/time/Instant;)Z
      named isExpiredOnServer Lnet/minecraft/network/message/SignedMessage;isExpiredOnServer(Ljava/time/Instant;)Z
    • isExpiredOnClient

      public boolean isExpiredOnClient(Instant currentTime)
      Mappings:
      Namespace Name Mixin selector
      official b Lsd;b(Ljava/time/Instant;)Z
      intermediary method_44748 Lnet/minecraft/class_7471;method_44748(Ljava/time/Instant;)Z
      named isExpiredOnClient Lnet/minecraft/network/message/SignedMessage;isExpiredOnClient(Ljava/time/Instant;)Z
    • createMetadata

      public MessageMetadata createMetadata()
      Mappings:
      Namespace Name Mixin selector
      official f Lsd;f()Lsa;
      intermediary method_44866 Lnet/minecraft/class_7471;method_44866()Lnet/minecraft/class_7470;
      named createMetadata Lnet/minecraft/network/message/SignedMessage;createMetadata()Lnet/minecraft/network/message/MessageMetadata;
    • toLastSeenMessageEntry

      @Nullable public LastSeenMessageList.Entry toLastSeenMessageEntry()
      Mappings:
      Namespace Name Mixin selector
      official g Lsd;g()Lrw$a;
      intermediary method_44995 Lnet/minecraft/class_7471;method_44995()Lnet/minecraft/class_7635$class_7609;
      named toLastSeenMessageEntry Lnet/minecraft/network/message/SignedMessage;toLastSeenMessageEntry()Lnet/minecraft/network/message/LastSeenMessageList$Entry;
    • canVerifyFrom

      public boolean canVerifyFrom(UUID sender)
      Returns whether the message can be verified as from sender.

      This does not actually verify that the message is, in fact, from sender. Rather, this returns whether it's possible to verify that sender sent this message.

      Returns:
      whether the message can be verified as from sender
      Mappings:
      Namespace Name Mixin selector
      official a Lsd;a(Ljava/util/UUID;)Z
      intermediary method_45040 Lnet/minecraft/class_7471;method_45040(Ljava/util/UUID;)Z
      named canVerifyFrom Lnet/minecraft/network/message/SignedMessage;canVerifyFrom(Ljava/util/UUID;)Z
    • isFullyFiltered

      public boolean isFullyFiltered()
      Mappings:
      Namespace Name Mixin selector
      official h Lsd;h()Z
      intermediary method_45100 Lnet/minecraft/class_7471;method_45100()Z
      named isFullyFiltered Lnet/minecraft/network/message/SignedMessage;isFullyFiltered()Z
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • signedHeader

      public MessageHeader signedHeader()
      Returns the value of the signedHeader record component.
      Returns:
      the value of the signedHeader record component
    • headerSignature

      public MessageSignatureData headerSignature()
      Returns the value of the headerSignature record component.
      Returns:
      the value of the headerSignature record component
    • signedBody

      public MessageBody signedBody()
      Returns the value of the signedBody record component.
      Returns:
      the value of the signedBody record component
    • unsignedContent

      public Optional<Text> unsignedContent()
      Returns the value of the unsignedContent record component.
      Returns:
      the value of the unsignedContent record component
    • filterMask

      public FilterMask filterMask()
      Returns the value of the filterMask record component.
      Returns:
      the value of the filterMask record component