Record Class MonkeyLibStyleImpl
java.lang.Object
java.lang.Record
top.offsetmonkey538.monkeylib538.modded.impl.text.MonkeyLibStyleImpl
- All Implemented Interfaces:
MonkeyLibStyle,ModdedMonkeyLibStyle
public record MonkeyLibStyleImpl(net.minecraft.network.chat.Style style)
extends Record
implements ModdedMonkeyLibStyle
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibStyle
MonkeyLibStyle.Color, MonkeyLibStyle.Provider -
Constructor Summary
ConstructorsConstructorDescriptionMonkeyLibStyleImpl(net.minecraft.network.chat.Style style) Creates an instance of aMonkeyLibStyleImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncopyEventsFrom(MonkeyLibStyle from) final booleanIndicates whether some other object is "equal to" this one.booleanequals(MonkeyLibStyle other) Checks if this style is equal to the provided one.final inthashCode()Returns a hash code value for this object.net.minecraft.network.chat.Stylestyle()Returns the value of thestylerecord component.final StringtoString()Returns a string representation of this record class.withColor(int rgbColor) Returns a new style with the provided rgb color.withCopyToClipboard(String value) @Nullable MonkeyLibStylewithFormattingCode(char code) Returns a new style with the formatting code.withItalic(boolean italic) Returns a new style with the provided italic attribute.withOpenFile(Path value) withOpenUrl(URI value) withRunCommand(String value) withShowText(MonkeyLibText value) withSuggestCommand(String value) withUnderline(boolean underline) Returns a new style with the provided underline attribute.
-
Constructor Details
-
MonkeyLibStyleImpl
public MonkeyLibStyleImpl(net.minecraft.network.chat.Style style) Creates an instance of aMonkeyLibStyleImplrecord class.- Parameters:
style- the value for thestylerecord component
-
-
Method Details
-
withShowText
- Specified by:
withShowTextin interfaceMonkeyLibStyle
-
withOpenUrl
- Specified by:
withOpenUrlin interfaceMonkeyLibStyle
-
withOpenFile
- Specified by:
withOpenFilein interfaceMonkeyLibStyle
-
withRunCommand
- Specified by:
withRunCommandin interfaceMonkeyLibStyle
-
withSuggestCommand
- Specified by:
withSuggestCommandin interfaceMonkeyLibStyle
-
withCopyToClipboard
- Specified by:
withCopyToClipboardin interfaceMonkeyLibStyle
-
copyEventsFrom
- Specified by:
copyEventsFromin interfaceMonkeyLibStyle
-
withItalic
Description copied from interface:MonkeyLibStyleReturns a new style with the provided italic attribute.- Specified by:
withItalicin interfaceMonkeyLibStyle- Parameters:
italic- if the new style should be italic- Returns:
- a new style with the provided italic attribute
-
withUnderline
Description copied from interface:MonkeyLibStyleReturns a new style with the provided underline attribute.- Specified by:
withUnderlinein interfaceMonkeyLibStyle- Parameters:
underline- if the new style should be underlined- Returns:
- a new style with the provided underline attribute
-
withColor
Description copied from interface:MonkeyLibStyleReturns a new style with the provided rgb color.- Specified by:
withColorin interfaceMonkeyLibStyle- Parameters:
rgbColor- the color in the 0xRRGGBB format- Returns:
- a new style with the provided color attribute
-
withFormattingCode
Description copied from interface:MonkeyLibStyleReturns a new style with the formatting code.- Specified by:
withFormattingCodein interfaceMonkeyLibStyle- Parameters:
code- the formatting code to use- Returns:
- a new style with the formatting code
-
equals
Description copied from interface:MonkeyLibStyleChecks if this style is equal to the provided one.- Specified by:
equalsin interfaceMonkeyLibStyle- Parameters:
other- the style to check against- Returns:
- if this style is equal to the provided one
-
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). -
style
public net.minecraft.network.chat.Style style()Returns the value of thestylerecord component.- Specified by:
stylein interfaceModdedMonkeyLibStyle- Returns:
- the value of the
stylerecord component
-