Class TextHandler.StyledString

java.lang.Object
net.minecraft.client.font.TextHandler.StyledString
All Implemented Interfaces:
StringVisitable
Enclosing class:
TextHandler

@Environment(CLIENT)
static class TextHandler.StyledString
extends Object
implements StringVisitable
  • Field Details

    • literal

      private final String literal
    • style

      private final Style style
  • Constructor Details

    • StyledString

      public StyledString​(String literal, Style style)
  • Method Details

    • visit

      public <T> Optional<T> visit​(StringVisitable.Visitor<T> visitor)
      Supplies this visitable's literal content to the visitor.
      Specified by:
      visit in interface StringVisitable
      Parameters:
      visitor - the visitor
      Returns:
      Optional.empty() if the visit finished, or a terminating result from the visitor
    • visit

      public <T> Optional<T> visit​(StringVisitable.StyledVisitor<T> styledVisitor, Style style)
      Supplies this visitable's literal content and contextual style to the visitor.
      Specified by:
      visit in interface StringVisitable
      Parameters:
      styledVisitor - the visitor
      style - the contextual style
      Returns:
      Optional.empty() if the visit finished, or a terminating result from the visitor