Interface StringVisitable

All Known Subinterfaces:
Text
All Known Implementing Classes:
MutableText, TextHandler.StyledString

public interface StringVisitable
An object that can supply strings to a visitor, with or without a style context.
Mappings:
Namespace Name
named net/minecraft/text/StringVisitable
intermediary net/minecraft/class_5348
official xd
  • Field Details

    • TERMINATE_VISIT

      static final Optional<Unit> TERMINATE_VISIT
      Convenience object indicating the termination of a string visit.
      Mappings:
      Namespace Name Mixin selector
      named TERMINATE_VISIT Lnet/minecraft/text/StringVisitable;TERMINATE_VISIT:Ljava/util/Optional;
      intermediary field_25309 Lnet/minecraft/class_5348;field_25309:Ljava/util/Optional;
      official a Lxd;a:Ljava/util/Optional;
    • EMPTY

      static final StringVisitable EMPTY
      An empty visitable that does not call the visitors.
      Mappings:
      Namespace Name Mixin selector
      named EMPTY Lnet/minecraft/text/StringVisitable;EMPTY:Lnet/minecraft/text/StringVisitable;
      intermediary field_25310 Lnet/minecraft/class_5348;field_25310:Lnet/minecraft/class_5348;
      official b Lxd;b:Lxd;
  • Method Details

    • visit

      <T> Optional<T> visit(StringVisitable.Visitor<T> visitor)
      Supplies this visitable's literal content to the visitor.
      Parameters:
      visitor - the visitor
      Returns:
      Optional.empty() if the visit finished, or a terminating result from the visitor
      Mappings:
      Namespace Name Mixin selector
      named visit Lnet/minecraft/text/StringVisitable;visit(Lnet/minecraft/text/StringVisitable$Visitor;)Ljava/util/Optional;
      intermediary method_27657 Lnet/minecraft/class_5348;method_27657(Lnet/minecraft/class_5348$class_5245;)Ljava/util/Optional;
      official a Lxd;a(Lxd$a;)Ljava/util/Optional;
    • visit

      <T> Optional<T> visit(StringVisitable.StyledVisitor<T> styledVisitor, Style style)
      Supplies this visitable's literal content and contextual style to the visitor.
      Parameters:
      styledVisitor - the visitor
      style - the contextual style
      Returns:
      Optional.empty() if the visit finished, or a terminating result from the visitor
      Mappings:
      Namespace Name Mixin selector
      named visit Lnet/minecraft/text/StringVisitable;visit(Lnet/minecraft/text/StringVisitable$StyledVisitor;Lnet/minecraft/text/Style;)Ljava/util/Optional;
      intermediary method_27658 Lnet/minecraft/class_5348;method_27658(Lnet/minecraft/class_5348$class_5246;Lnet/minecraft/class_2583;)Ljava/util/Optional;
      official a Lxd;a(Lxd$b;Lxv;)Ljava/util/Optional;
    • plain

      static StringVisitable plain(String string)
      Creates a visitable from a plain string.
      Parameters:
      string - the plain string
      Mappings:
      Namespace Name Mixin selector
      named plain Lnet/minecraft/text/StringVisitable;plain(Ljava/lang/String;)Lnet/minecraft/text/StringVisitable;
      intermediary method_29430 Lnet/minecraft/class_5348;method_29430(Ljava/lang/String;)Lnet/minecraft/class_5348;
      official e Lxd;e(Ljava/lang/String;)Lxd;
    • styled

      static StringVisitable styled(String string, Style style)
      Creates a visitable from a plain string and a root style.
      Parameters:
      string - the plain string
      style - the root style
      Mappings:
      Namespace Name Mixin selector
      named styled Lnet/minecraft/text/StringVisitable;styled(Ljava/lang/String;Lnet/minecraft/text/Style;)Lnet/minecraft/text/StringVisitable;
      intermediary method_29431 Lnet/minecraft/class_5348;method_29431(Ljava/lang/String;Lnet/minecraft/class_2583;)Lnet/minecraft/class_5348;
      official a Lxd;a(Ljava/lang/String;Lxv;)Lxd;
    • concat

      static StringVisitable concat(StringVisitable[] visitables)
      Concats multiple string visitables by the order they appear in the array.
      Parameters:
      visitables - an array or varargs of visitables
      Mappings:
      Namespace Name Mixin selector
      named concat Lnet/minecraft/text/StringVisitable;concat([Lnet/minecraft/text/StringVisitable;)Lnet/minecraft/text/StringVisitable;
      intermediary method_29433 Lnet/minecraft/class_5348;method_29433([Lnet/minecraft/class_5348;)Lnet/minecraft/class_5348;
      official a Lxd;a([Lxd;)Lxd;
    • concat

      static StringVisitable concat(List<? extends StringVisitable> visitables)
      Concats multiple string visitables by the order they appear in the list.
      Parameters:
      visitables - a list of visitables
      Mappings:
      Namespace Name Mixin selector
      named concat Lnet/minecraft/text/StringVisitable;concat(Ljava/util/List;)Lnet/minecraft/text/StringVisitable;
      intermediary method_29432 Lnet/minecraft/class_5348;method_29432(Ljava/util/List;)Lnet/minecraft/class_5348;
      official a Lxd;a(Ljava/util/List;)Lxd;
    • getString

      default String getString()