Interface StringVisitable.StyledVisitor<T>

Enclosing interface:
StringVisitable

public static interface StringVisitable.StyledVisitor<T>
A visitor for string content and a contextual Style.
Mappings:
Namespace Name
official ov$b
intermediary net/minecraft/class_5348$class_5246
named net/minecraft/text/StringVisitable$StyledVisitor
  • Method Summary

    Modifier and Type
    Method
    Description
    accept(Style style, String asString)
    Visits a string's content with a contextual style.
  • Method Details

    • accept

      Optional<T> accept(Style style, String asString)
      Visits a string's content with a contextual style.

      A contextual style is obtained by calling Style.withParent(Style) on the current's text style, passing the previous contextual style or the starting style if it is the beginning of a visit.

      When a present optional is returned, the visit is terminated before visiting all text. Can return StringVisitable.TERMINATE_VISIT for convenience.

      Parameters:
      style - the current style
      asString - the literal string
      Returns:
      Optional.empty() to continue, a non-empty result to terminate
      Mappings:
      Namespace Name Mixin selector
      official accept Lov$b;accept(Lpc;Ljava/lang/String;)Ljava/util/Optional;
      intermediary accept Lnet/minecraft/class_5348$class_5246;accept(Lnet/minecraft/class_2583;Ljava/lang/String;)Ljava/util/Optional;
      named accept Lnet/minecraft/text/StringVisitable$StyledVisitor;accept(Lnet/minecraft/text/Style;Ljava/lang/String;)Ljava/util/Optional;