Interface MonkeyLibText

All Known Subinterfaces:
ModdedMonkeyLibText
All Known Implementing Classes:
MonkeyLibTextImpl

public interface MonkeyLibText
Abstraction around a vanilla Text. Use of(String) to create instances.

Platform-specific implementation should store their MutableText equivalent and modify it when these methods are called.

  • Method Details

    • getLastSibling

      @Nullable MonkeyLibText getLastSibling()
      Returns the last sibling of this text.
      Returns:
      the last sibling of this text
    • setLastSibling

      MonkeyLibText setLastSibling(MonkeyLibText newSibling)
      Sets the last sibling of this text.
      Returns:
      this.
    • append

      Appends another text to this one.
      Parameters:
      other - the text to append to this one
      Returns:
      this.
    • getStyle

      MonkeyLibStyle getStyle()
      Gets the style of this text.
      Returns:
      The style of this text
    • setStyle

      MonkeyLibText setStyle(MonkeyLibStyle style)
      Sets the style of this text to the provided style.
      Parameters:
      style - the style to use.
      Returns:
      this.
    • applyStyle

      default MonkeyLibText applyStyle(UnaryOperator<MonkeyLibStyle> styleModifier)
      Applies the provided operations to this text's style.
      Parameters:
      styleModifier - the operations to apply.
      Returns:
      this.
    • getString

      String getString()
      Gets the content of this text
      Returns:
      the content of this text
    • of

      static MonkeyLibText of(String text)
      Creates a literal text
      Parameters:
      text - the text it should contain.
      Returns:
      a literal text
    • empty

      static MonkeyLibText empty()
      Creates an empty literal text
      Returns:
      an empty text