Record Class MessageBody

java.lang.Object
java.lang.Record
net.minecraft.network.message.MessageBody
Record Components:
content -
timestamp -
salt -
lastSeenMessages -

public record MessageBody(DecoratedContents content, Instant timestamp, long salt, LastSeenMessageList lastSeenMessages) extends Record
A body of a message, including the content, timestamp, salt used for the digest (the hashed body), and the list of players' "last seen messages". Unlike MessageHeader, clients do not receive this if the message is censored; they receive the digest only.
Mappings:
Namespace Name
official sf
intermediary net/minecraft/class_7608
named net/minecraft/network/message/MessageBody
official b
intermediary comp_929
named content
official c
intermediary comp_930
named timestamp
official d
intermediary comp_931
named salt
official e
intermediary comp_932
named lastSeenMessages
  • Field Details

    • content

      private final DecoratedContents content
      The field for the content record component.
    • timestamp

      private final Instant timestamp
      The field for the timestamp record component.
    • salt

      private final long salt
      The field for the salt record component.
    • lastSeenMessages

      private final LastSeenMessageList lastSeenMessages
      The field for the lastSeenMessages record component.
    • LAST_SEEN_SEPARATOR

      public static final byte LAST_SEEN_SEPARATOR
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lsf;a:B
      intermediary field_39817 Lnet/minecraft/class_7608;field_39817:B
      named LAST_SEEN_SEPARATOR Lnet/minecraft/network/message/MessageBody;LAST_SEEN_SEPARATOR:B
  • Constructor Details

    • MessageBody

      public MessageBody(PacketByteBuf buf)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lsf;<init>(Lqx;)V
      intermediary <init> Lnet/minecraft/class_7608;<init>(Lnet/minecraft/class_2540;)V
      named <init> Lnet/minecraft/network/message/MessageBody;<init>(Lnet/minecraft/network/PacketByteBuf;)V
    • MessageBody

      public MessageBody(DecoratedContents decoratedContents, Instant instant, long long2, LastSeenMessageList lastSeenMessageList)
  • Method Details

    • write

      public void write(PacketByteBuf buf)
      Mappings:
      Namespace Name Mixin selector
      official a Lsf;a(Lqx;)V
      intermediary method_44869 Lnet/minecraft/class_7608;method_44869(Lnet/minecraft/class_2540;)V
      named write Lnet/minecraft/network/message/MessageBody;write(Lnet/minecraft/network/PacketByteBuf;)V
    • digest

      public HashCode digest()
      Returns the digest of this body.
      Returns:
      the digest of this body
      Implementation Note:
      This is a SHA-256 hash of the salt, the timestamp represented as the seconds since the Unix epoch, the content, and the list of each player's last seen message.
      Mappings:
      Namespace Name Mixin selector
      official a Lsf;a()Lcom/google/common/hash/HashCode;
      intermediary method_44867 Lnet/minecraft/class_7608;method_44867()Lcom/google/common/hash/HashCode;
      named digest Lnet/minecraft/network/message/MessageBody;digest()Lcom/google/common/hash/HashCode;
    • withContent

      public MessageBody withContent(DecoratedContents content)
      Returns a new message body with its content replaced with content.
      Returns:
      a new message body with its content replaced with content
      Mappings:
      Namespace Name Mixin selector
      official a Lsf;a(Lri;)Lsf;
      intermediary method_45047 Lnet/minecraft/class_7608;method_45047(Lnet/minecraft/class_7634;)Lnet/minecraft/class_7608;
      named withContent Lnet/minecraft/network/message/MessageBody;withContent(Lnet/minecraft/network/message/DecoratedContents;)Lnet/minecraft/network/message/MessageBody;
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • content

      public DecoratedContents content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • salt

      public long salt()
      Returns the value of the salt record component.
      Returns:
      the value of the salt record component
    • lastSeenMessages

      public LastSeenMessageList lastSeenMessages()
      Returns the value of the lastSeenMessages record component.
      Returns:
      the value of the lastSeenMessages record component