Record Class PlayerChatMessage

java.lang.Object
java.lang.Record
net.minecraft.network.chat.PlayerChatMessage

public record PlayerChatMessage(SignedMessageHeader signedHeader, MessageSignature headerSignature, SignedMessageBody signedBody, Optional<Component> unsignedContent, FilterMask filterMask) extends Record
  • Field Details

    • signedHeader

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

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

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

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

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

      public static final Duration MESSAGE_EXPIRES_AFTER_SERVER
    • MESSAGE_EXPIRES_AFTER_CLIENT

      public static final Duration MESSAGE_EXPIRES_AFTER_CLIENT
  • Constructor Details

    • PlayerChatMessage

      public PlayerChatMessage(FriendlyByteBuf p_241419_)
    • PlayerChatMessage

      public PlayerChatMessage(SignedMessageHeader signedHeader, MessageSignature headerSignature, SignedMessageBody signedBody, Optional<Component> unsignedContent, FilterMask filterMask)
      Creates an instance of a PlayerChatMessage record class.
      Parameters:
      signedHeader - the value for the signedHeader record component
      headerSignature - the value for the headerSignature record component
      signedBody - the value for the signedBody record component
      unsignedContent - the value for the unsignedContent record component
      filterMask - the value for the filterMask record component
  • Method Details

    • system

      public static PlayerChatMessage system(ChatMessageContent p_242910_)
    • unsigned

      public static PlayerChatMessage unsigned(MessageSigner p_243247_, ChatMessageContent p_243279_)
    • write

      public void write(FriendlyByteBuf p_241490_)
    • withUnsignedContent

      public PlayerChatMessage withUnsignedContent(Component p_242164_)
    • removeUnsignedContent

      public PlayerChatMessage removeUnsignedContent()
    • filter

      public PlayerChatMessage filter(FilterMask p_243320_)
    • filter

      public PlayerChatMessage filter(boolean p_243223_)
    • verify

      public boolean verify(SignatureValidator p_241442_)
    • verify

      public boolean verify(ProfilePublicKey p_237229_)
    • verify

      public boolean verify(ChatSender p_241394_)
    • signedContent

      public ChatMessageContent signedContent()
    • serverContent

      public Component serverContent()
    • timeStamp

      public Instant timeStamp()
    • salt

      public long salt()
    • hasExpiredServer

      public boolean hasExpiredServer(Instant p_240573_)
    • hasExpiredClient

      public boolean hasExpiredClient(Instant p_240629_)
    • signer

      public MessageSigner signer()
    • toLastSeenEntry

      @Nullable public LastSeenMessages.Entry toLastSeenEntry()
    • hasSignatureFrom

      public boolean hasSignatureFrom(UUID p_243236_)
    • isFullyFiltered

      public boolean isFullyFiltered()
    • 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 o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • signedHeader

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

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

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

      public Optional<Component> 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