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
named net/minecraft/text/StringVisitable$StyledVisitor
intermediary net/minecraft/class_5348$class_5246
official ya$b
  • 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:
      asString - the literal string
      Returns:
      Optional.empty() to continue, a non-empty result to terminate
      Mappings:
      Namespace Name Mixin selector
      named accept Lnet/minecraft/text/StringVisitable$StyledVisitor;accept(Lnet/minecraft/text/Style;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;
      official accept Lya$b;accept(Lys;Ljava/lang/String;)Ljava/util/Optional;