Package guideme.style

Record Class TextStyle

java.lang.Object
java.lang.Record
guideme.style.TextStyle

public record TextStyle(@Nullable Float fontScale, @Nullable Boolean bold, @Nullable Boolean italic, @Nullable Boolean underlined, @Nullable Boolean strikethrough, @Nullable Boolean obfuscated, @Nullable net.minecraft.resources.ResourceLocation font, @Nullable ColorValue color, @Nullable WhiteSpaceMode whiteSpace, @Nullable TextAlignment alignment, @Nullable Boolean dropShadow) extends Record
A text style that only contains a subset of properties found in ResolvedTextStyle.
  • Field Details

    • EMPTY

      public static final TextStyle EMPTY
  • Constructor Details

    • TextStyle

      public TextStyle(@Nullable @Nullable Float fontScale, @Nullable @Nullable Boolean bold, @Nullable @Nullable Boolean italic, @Nullable @Nullable Boolean underlined, @Nullable @Nullable Boolean strikethrough, @Nullable @Nullable Boolean obfuscated, @Nullable @Nullable net.minecraft.resources.ResourceLocation font, @Nullable @Nullable ColorValue color, @Nullable @Nullable WhiteSpaceMode whiteSpace, @Nullable @Nullable TextAlignment alignment, @Nullable @Nullable Boolean dropShadow)
      Creates an instance of a TextStyle record class.
      Parameters:
      fontScale - the value for the fontScale 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
      color - the value for the color record component
      whiteSpace - the value for the whiteSpace record component
      alignment - the value for the alignment record component
      dropShadow - the value for the dropShadow record component
  • Method Details

    • mergeWith

      public ResolvedTextStyle mergeWith(ResolvedTextStyle base)
    • toBuilder

      public TextStyle.Builder toBuilder()
    • builder

      public static TextStyle.Builder builder()
    • 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.
    • fontScale

      @Nullable public @Nullable Float fontScale()
      Returns the value of the fontScale record component.
      Returns:
      the value of the fontScale record component
    • bold

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

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

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

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

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

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation font()
      Returns the value of the font record component.
      Returns:
      the value of the font record component
    • color

      @Nullable public @Nullable ColorValue color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • whiteSpace

      @Nullable public @Nullable WhiteSpaceMode whiteSpace()
      Returns the value of the whiteSpace record component.
      Returns:
      the value of the whiteSpace record component
    • alignment

      @Nullable public @Nullable TextAlignment alignment()
      Returns the value of the alignment record component.
      Returns:
      the value of the alignment record component
    • dropShadow

      @Nullable public @Nullable Boolean dropShadow()
      Returns the value of the dropShadow record component.
      Returns:
      the value of the dropShadow record component