Package devs.beer.nativepackets.api
Record Class NativeTextStyle
java.lang.Object
java.lang.Record
devs.beer.nativepackets.api.NativeTextStyle
public record NativeTextStyle(Integer color, Boolean bold, Boolean italic, Boolean underlined, Boolean strikethrough, Boolean obfuscated, String font, String insertion, NativeClickEvent clickEvent, NativeHoverEvent hoverEvent)
extends Record
Version-neutral component style. Nullable Boolean fields retain Minecraft's inherited/unset state.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNativeTextStyle(Integer color, Boolean bold, Boolean italic, Boolean underlined, Boolean strikethrough, Boolean obfuscated, String font, String insertion, NativeClickEvent clickEvent, NativeHoverEvent hoverEvent) Creates an instance of aNativeTextStylerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbold()Returns the value of theboldrecord component.Returns the value of theclickEventrecord component.color()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.font()Returns the value of thefontrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thehoverEventrecord component.Returns the value of theinsertionrecord component.italic()Returns the value of theitalicrecord component.Returns the value of theobfuscatedrecord component.Returns the value of thestrikethroughrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theunderlinedrecord component.
-
Field Details
-
EMPTY
Empty/inheriting style.
-
-
Constructor Details
-
NativeTextStyle
public NativeTextStyle(@Nullable Integer color, @Nullable Boolean bold, @Nullable Boolean italic, @Nullable Boolean underlined, @Nullable Boolean strikethrough, @Nullable Boolean obfuscated, @Nullable String font, @Nullable String insertion, @Nullable NativeClickEvent clickEvent, @Nullable NativeHoverEvent hoverEvent) Creates an instance of aNativeTextStylerecord class.- Parameters:
color- the value for thecolorrecord 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 componentinsertion- the value for theinsertionrecord componentclickEvent- the value for theclickEventrecord componenthoverEvent- the value for thehoverEventrecord component
-
-
Method Details
-
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). -
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord 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
Returns the value of thefontrecord component.- Returns:
- the value of the
fontrecord component
-
insertion
Returns the value of theinsertionrecord component.- Returns:
- the value of the
insertionrecord component
-
clickEvent
Returns the value of theclickEventrecord component.- Returns:
- the value of the
clickEventrecord component
-
hoverEvent
Returns the value of thehoverEventrecord component.- Returns:
- the value of the
hoverEventrecord component
-