Record Class TextGizmo.Style

java.lang.Object
java.lang.Record
net.minecraft.gizmos.TextGizmo.Style
Enclosing class:
TextGizmo

public static record TextGizmo.Style(int color, float scale, OptionalDouble adjustLeft) extends Record
  • Field Details

    • color

      private final int color
      The field for the color record component.
    • scale

      private final float scale
      The field for the scale record component.
    • adjustLeft

      private final OptionalDouble adjustLeft
      The field for the adjustLeft record component.
    • DEFAULT_SCALE

      public static final float DEFAULT_SCALE
      See Also:
  • Constructor Details

    • Style

      public Style(int color, float scale, OptionalDouble adjustLeft)
      Creates an instance of a Style record class.
      Parameters:
      color - the value for the color record component
      scale - the value for the scale record component
      adjustLeft - the value for the adjustLeft record component
  • Method Details

    • whiteAndCentered

      public static TextGizmo.Style whiteAndCentered()
    • forColorAndCentered

      public static TextGizmo.Style forColorAndCentered(int pColor)
    • forColor

      public static TextGizmo.Style forColor(int pColor)
    • withScale

      public TextGizmo.Style withScale(float pScale)
    • withLeftAlignment

      public TextGizmo.Style withLeftAlignment(float pLeftAlignment)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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

      public int color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • scale

      public float scale()
      Returns the value of the scale record component.
      Returns:
      the value of the scale record component
    • adjustLeft

      public OptionalDouble adjustLeft()
      Returns the value of the adjustLeft record component.
      Returns:
      the value of the adjustLeft record component