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.network.chat.FontDescription 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.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTextStyle(@Nullable Float fontScale, @Nullable Boolean bold, @Nullable Boolean italic, @Nullable Boolean underlined, @Nullable Boolean strikethrough, @Nullable Boolean obfuscated, @Nullable net.minecraft.network.chat.FontDescription font, @Nullable ColorValue color, @Nullable WhiteSpaceMode whiteSpace, @Nullable TextAlignment alignment, @Nullable Boolean dropShadow) Creates an instance of aTextStylerecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable TextAlignmentReturns the value of thealignmentrecord component.@Nullable Booleanbold()Returns the value of theboldrecord component.static TextStyle.Builderbuilder()@Nullable ColorValuecolor()Returns the value of thecolorrecord component.@Nullable BooleanReturns the value of thedropShadowrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable net.minecraft.network.chat.FontDescriptionfont()Returns the value of thefontrecord component.@Nullable FloatReturns the value of thefontScalerecord component.final inthashCode()Returns a hash code value for this object.@Nullable Booleanitalic()Returns the value of theitalicrecord component.mergeWith(ResolvedTextStyle base) @Nullable BooleanReturns the value of theobfuscatedrecord component.@Nullable BooleanReturns the value of thestrikethroughrecord component.final StringtoString()Returns a string representation of this record class.@Nullable BooleanReturns the value of theunderlinedrecord component.@Nullable WhiteSpaceModeReturns the value of thewhiteSpacerecord component.
-
Field Details
-
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.network.chat.FontDescription font, @Nullable @Nullable ColorValue color, @Nullable @Nullable WhiteSpaceMode whiteSpace, @Nullable @Nullable TextAlignment alignment, @Nullable @Nullable Boolean dropShadow) Creates an instance of aTextStylerecord class.- Parameters:
fontScale- the value for thefontScalerecord componentbold- the value for theboldrecord componentitalic- the value for theitalicrecord componentunderlined- the value for theunderlinedrecord componentstrikethrough- the value for thestrikethroughrecord componentobfuscated- the value for theobfuscatedrecord componentfont- the value for thefontrecord componentcolor- the value for thecolorrecord componentwhiteSpace- the value for thewhiteSpacerecord componentalignment- the value for thealignmentrecord componentdropShadow- the value for thedropShadowrecord component
-
-
Method Details
-
mergeWith
-
toBuilder
-
builder
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
fontScale
Returns the value of thefontScalerecord component.- Returns:
- the value of the
fontScalerecord component
-
bold
Returns the value of theboldrecord component.- Returns:
- the value of the
boldrecord component
-
italic
Returns the value of theitalicrecord component.- Returns:
- the value of the
italicrecord component
-
underlined
Returns the value of theunderlinedrecord component.- Returns:
- the value of the
underlinedrecord component
-
strikethrough
Returns the value of thestrikethroughrecord component.- Returns:
- the value of the
strikethroughrecord component
-
obfuscated
Returns the value of theobfuscatedrecord component.- Returns:
- the value of the
obfuscatedrecord component
-
font
@Nullable public @Nullable net.minecraft.network.chat.FontDescription font()Returns the value of thefontrecord component.- Returns:
- the value of the
fontrecord component
-
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
whiteSpace
Returns the value of thewhiteSpacerecord component.- Returns:
- the value of the
whiteSpacerecord component
-
alignment
Returns the value of thealignmentrecord component.- Returns:
- the value of the
alignmentrecord component
-
dropShadow
Returns the value of thedropShadowrecord component.- Returns:
- the value of the
dropShadowrecord component
-