Record Class ChatMessageContent

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

public record ChatMessageContent(String plain, Component decorated) extends Record
  • Field Details

    • plain

      private final String plain
      The field for the plain record component.
    • decorated

      private final Component decorated
      The field for the decorated record component.
  • Constructor Details

    • ChatMessageContent

      public ChatMessageContent(String p_242420_)
    • ChatMessageContent

      public ChatMessageContent(String plain, Component decorated)
      Creates an instance of a ChatMessageContent record class.
      Parameters:
      plain - the value for the plain record component
      decorated - the value for the decorated record component
  • Method Details

    • isDecorated

      public boolean isDecorated()
    • read

      public static ChatMessageContent read(FriendlyByteBuf p_242370_)
    • write

      public static void write(FriendlyByteBuf p_242211_, ChatMessageContent p_242235_)
    • 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.
    • plain

      public String plain()
      Returns the value of the plain record component.
      Returns:
      the value of the plain record component
    • decorated

      public Component decorated()
      Returns the value of the decorated record component.
      Returns:
      the value of the decorated record component