Record Class PlayerChatMessage

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

public record PlayerChatMessage(SignedMessageLink link, @Nullable MessageSignature signature, SignedMessageBody signedBody, @Nullable Component unsignedContent, FilterMask filterMask) extends Record
  • Field Details

    • signature

      @Nullable private final MessageSignature signature
      The field for the signature record component.
    • signedBody

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

      @Nullable private final Component unsignedContent
      The field for the unsignedContent record component.
    • filterMask

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

      public static final com.mojang.serialization.MapCodec<PlayerChatMessage> MAP_CODEC
    • SYSTEM_SENDER

      private static final UUID SYSTEM_SENDER
    • 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(SignedMessageLink link, @Nullable MessageSignature signature, SignedMessageBody signedBody, @Nullable Component unsignedContent, FilterMask filterMask)
      Creates an instance of a PlayerChatMessage record class.
      Parameters:
      link - the value for the link record component
      signature - the value for the signature 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(String p_249209_)
    • unsigned

      public static PlayerChatMessage unsigned(UUID p_251783_, String p_251615_)
    • 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_)
    • updateSignature

      public static void updateSignature(SignatureUpdater.Output p_250661_, SignedMessageLink p_248621_, SignedMessageBody p_248823_) throws SignatureException
      Throws:
      SignatureException
    • verify

      public boolean verify(SignatureValidator p_241442_)
    • signedContent

      public String signedContent()
    • decoratedContent

      public Component decoratedContent()
    • timeStamp

      public Instant timeStamp()
    • salt

      public long salt()
    • hasExpiredServer

      public boolean hasExpiredServer(Instant p_240573_)
    • hasExpiredClient

      public boolean hasExpiredClient(Instant p_240629_)
    • sender

      public UUID sender()
    • isSystem

      public boolean isSystem()
    • hasSignature

      public boolean hasSignature()
    • 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.
    • link

      public SignedMessageLink link()
      Returns the value of the link record component.
      Returns:
      the value of the link record component
    • signature

      @Nullable public MessageSignature signature()
      Returns the value of the signature record component.
      Returns:
      the value of the signature record component
    • signedBody

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

      @Nullable public 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