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
  • Constructor Details

    • MonkeyLibStyleImpl

      public MonkeyLibStyleImpl(net.minecraft.network.chat.Style style)
      Creates an instance of a MonkeyLibStyleImpl record class.
      Parameters:
      style - the value for the style record component
  • Method Details

    • withShowText

      public MonkeyLibStyle withShowText(MonkeyLibText value)
      Specified by:
      withShowText in interface MonkeyLibStyle
    • withOpenUrl

      public MonkeyLibStyle withOpenUrl(URI value)
      Specified by:
      withOpenUrl in interface MonkeyLibStyle
    • withOpenFile

      public MonkeyLibStyle withOpenFile(Path value)
      Specified by:
      withOpenFile in interface MonkeyLibStyle
    • withRunCommand

      public MonkeyLibStyle withRunCommand(String value)
      Specified by:
      withRunCommand in interface MonkeyLibStyle
    • withSuggestCommand

      public MonkeyLibStyle withSuggestCommand(String value)
      Specified by:
      withSuggestCommand in interface MonkeyLibStyle
    • withCopyToClipboard

      public MonkeyLibStyle withCopyToClipboard(String value)
      Specified by:
      withCopyToClipboard in interface MonkeyLibStyle
    • copyEventsFrom

      public MonkeyLibStyle copyEventsFrom(MonkeyLibStyle from)
      Specified by:
      copyEventsFrom in interface MonkeyLibStyle
    • withItalic

      public MonkeyLibStyle withItalic(boolean italic)
      Description copied from interface: MonkeyLibStyle
      Returns a new style with the provided italic attribute.
      Specified by:
      withItalic in interface MonkeyLibStyle
      Parameters:
      italic - if the new style should be italic
      Returns:
      a new style with the provided italic attribute
    • withUnderline

      public MonkeyLibStyle withUnderline(boolean underline)
      Description copied from interface: MonkeyLibStyle
      Returns a new style with the provided underline attribute.
      Specified by:
      withUnderline in interface MonkeyLibStyle
      Parameters:
      underline - if the new style should be underlined
      Returns:
      a new style with the provided underline attribute
    • withColor

      public MonkeyLibStyle withColor(int rgbColor)
      Description copied from interface: MonkeyLibStyle
      Returns a new style with the provided rgb color.
      Specified by:
      withColor in interface MonkeyLibStyle
      Parameters:
      rgbColor - the color in the 0xRRGGBB format
      Returns:
      a new style with the provided color attribute
    • withFormattingCode

      public @Nullable MonkeyLibStyle withFormattingCode(char code)
      Description copied from interface: MonkeyLibStyle
      Returns a new style with the formatting code.
      Specified by:
      withFormattingCode in interface MonkeyLibStyle
      Parameters:
      code - the formatting code to use
      Returns:
      a new style with the formatting code
    • equals

      public boolean equals(MonkeyLibStyle other)
      Description copied from interface: MonkeyLibStyle
      Checks if this style is equal to the provided one.
      Specified by:
      equals in interface MonkeyLibStyle
      Parameters:
      other - the style to check against
      Returns:
      if this style is equal to the provided one
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • style

      public net.minecraft.network.chat.Style style()
      Returns the value of the style record component.
      Specified by:
      style in interface ModdedMonkeyLibStyle
      Returns:
      the value of the style record component