Package net.minecraft.text
Interface StringVisitable.StyledVisitor<T>
- Enclosing interface:
- StringVisitable
@Environment(CLIENT)
public static interface StringVisitable.StyledVisitor<T>
A visitor for string content and a contextual
Style
.-
Method Summary
-
Method Details
-
accept
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 returnStringVisitable.TERMINATE_VISIT
for convenience.- Parameters:
style
- the current styleasString
- the literal string- Returns:
Optional.empty()
to continue, a non-empty result to terminate
-