Package net.minecraft.gizmos
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final OptionalDoubleThe field for theadjustLeftrecord component.private final intThe field for thecolorrecord component.static final floatprivate final floatThe field for thescalerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionStyle(int color, float scale, OptionalDouble adjustLeft) Creates an instance of aStylerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadjustLeftrecord component.intcolor()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.static TextGizmo.StyleforColor(int pColor) static TextGizmo.StyleforColorAndCentered(int pColor) final inthashCode()Returns a hash code value for this object.floatscale()Returns the value of thescalerecord component.final StringtoString()Returns a string representation of this record class.static TextGizmo.StylewithLeftAlignment(float pLeftAlignment) withScale(float pScale)
-
Field Details
-
color
private final int colorThe field for thecolorrecord component. -
scale
private final float scaleThe field for thescalerecord component. -
adjustLeft
The field for theadjustLeftrecord component. -
DEFAULT_SCALE
public static final float DEFAULT_SCALE- See Also:
-
-
Constructor Details
-
Style
Creates an instance of aStylerecord class.- Parameters:
color- the value for thecolorrecord componentscale- the value for thescalerecord componentadjustLeft- the value for theadjustLeftrecord component
-
-
Method Details
-
whiteAndCentered
-
forColorAndCentered
-
forColor
-
withScale
-
withLeftAlignment
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
color
public int color()Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
scale
public float scale()Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-
adjustLeft
Returns the value of theadjustLeftrecord component.- Returns:
- the value of the
adjustLeftrecord component
-