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
.-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTextStyle
(@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) Creates an instance of aTextStyle
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable TextAlignment
Returns the value of thealignment
record component.@Nullable Boolean
bold()
Returns the value of thebold
record component.static TextStyle.Builder
builder()
@Nullable ColorValue
color()
Returns the value of thecolor
record component.@Nullable Boolean
Returns the value of thedropShadow
record component.final boolean
Indicates whether some other object is "equal to" this one.@Nullable net.minecraft.resources.ResourceLocation
font()
Returns the value of thefont
record component.@Nullable Float
Returns the value of thefontScale
record component.final int
hashCode()
Returns a hash code value for this object.@Nullable Boolean
italic()
Returns the value of theitalic
record component.mergeWith
(ResolvedTextStyle base) @Nullable Boolean
Returns the value of theobfuscated
record component.@Nullable Boolean
Returns the value of thestrikethrough
record component.final String
toString()
Returns a string representation of this record class.@Nullable Boolean
Returns the value of theunderlined
record component.@Nullable WhiteSpaceMode
Returns the value of thewhiteSpace
record 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.resources.ResourceLocation font, @Nullable @Nullable ColorValue color, @Nullable @Nullable WhiteSpaceMode whiteSpace, @Nullable @Nullable TextAlignment alignment, @Nullable @Nullable Boolean dropShadow) Creates an instance of aTextStyle
record class.- Parameters:
fontScale
- the value for thefontScale
record componentbold
- the value for thebold
record componentitalic
- the value for theitalic
record componentunderlined
- the value for theunderlined
record componentstrikethrough
- the value for thestrikethrough
record componentobfuscated
- the value for theobfuscated
record componentfont
- the value for thefont
record componentcolor
- the value for thecolor
record componentwhiteSpace
- the value for thewhiteSpace
record componentalignment
- the value for thealignment
record componentdropShadow
- the value for thedropShadow
record 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 thefontScale
record component.- Returns:
- the value of the
fontScale
record component
-
bold
Returns the value of thebold
record component.- Returns:
- the value of the
bold
record component
-
italic
Returns the value of theitalic
record component.- Returns:
- the value of the
italic
record component
-
underlined
Returns the value of theunderlined
record component.- Returns:
- the value of the
underlined
record component
-
strikethrough
Returns the value of thestrikethrough
record component.- Returns:
- the value of the
strikethrough
record component
-
obfuscated
Returns the value of theobfuscated
record component.- Returns:
- the value of the
obfuscated
record component
-
font
@Nullable public @Nullable net.minecraft.resources.ResourceLocation font()Returns the value of thefont
record component.- Returns:
- the value of the
font
record component
-
color
Returns the value of thecolor
record component.- Returns:
- the value of the
color
record component
-
whiteSpace
Returns the value of thewhiteSpace
record component.- Returns:
- the value of the
whiteSpace
record component
-
alignment
Returns the value of thealignment
record component.- Returns:
- the value of the
alignment
record component
-
dropShadow
Returns the value of thedropShadow
record component.- Returns:
- the value of the
dropShadow
record component
-