Record Class NativeTextStyle

java.lang.Object
java.lang.Record
devs.beer.nativepackets.api.NativeTextStyle

public record NativeTextStyle(Integer color, Boolean bold, Boolean italic, Boolean underlined, Boolean strikethrough, Boolean obfuscated, String font, String insertion, NativeClickEvent clickEvent, NativeHoverEvent hoverEvent) extends Record
Version-neutral component style. Nullable Boolean fields retain Minecraft's inherited/unset state.
  • Field Details

    • EMPTY

      public static final NativeTextStyle EMPTY
      Empty/inheriting style.
  • Constructor Details

    • NativeTextStyle

      public NativeTextStyle(@Nullable Integer color, @Nullable Boolean bold, @Nullable Boolean italic, @Nullable Boolean underlined, @Nullable Boolean strikethrough, @Nullable Boolean obfuscated, @Nullable String font, @Nullable String insertion, @Nullable NativeClickEvent clickEvent, @Nullable NativeHoverEvent hoverEvent)
      Creates an instance of a NativeTextStyle record class.
      Parameters:
      color - the value for the color record component
      bold - the value for the bold record component
      italic - the value for the italic record component
      underlined - the value for the underlined record component
      strikethrough - the value for the strikethrough record component
      obfuscated - the value for the obfuscated record component
      font - the value for the font record component
      insertion - the value for the insertion record component
      clickEvent - the value for the clickEvent record component
      hoverEvent - the value for the hoverEvent record component
  • Method Details

    • 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.
    • color

      @Nullable public Integer color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • bold

      @Nullable public Boolean bold()
      Returns the value of the bold record component.
      Returns:
      the value of the bold record component
    • italic

      @Nullable public Boolean italic()
      Returns the value of the italic record component.
      Returns:
      the value of the italic record component
    • underlined

      @Nullable public Boolean underlined()
      Returns the value of the underlined record component.
      Returns:
      the value of the underlined record component
    • strikethrough

      @Nullable public Boolean strikethrough()
      Returns the value of the strikethrough record component.
      Returns:
      the value of the strikethrough record component
    • obfuscated

      @Nullable public Boolean obfuscated()
      Returns the value of the obfuscated record component.
      Returns:
      the value of the obfuscated record component
    • font

      @Nullable public String font()
      Returns the value of the font record component.
      Returns:
      the value of the font record component
    • insertion

      @Nullable public String insertion()
      Returns the value of the insertion record component.
      Returns:
      the value of the insertion record component
    • clickEvent

      @Nullable public NativeClickEvent clickEvent()
      Returns the value of the clickEvent record component.
      Returns:
      the value of the clickEvent record component
    • hoverEvent

      @Nullable public NativeHoverEvent hoverEvent()
      Returns the value of the hoverEvent record component.
      Returns:
      the value of the hoverEvent record component