Interface InlineClientAPI
public interface InlineClientAPI
The main Inline Client API. Primarly for managing matchers and renderers.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMatcher(InlineMatcher matcher) Register anInlineMatchervoidaddRenderer(InlineRenderer<?> renderer) Register anInlineRendererGet all registered matchersSet<InlineRenderer<?>> Get all registered renderersGet the client config.getMatched(String input) Gets a frozen/read-onlyMatchContextwith all currently enabled client-side matchers (seegetAllMatchers()andInlineClientConfig.isMatcherEnabled(net.minecraft.util.Identifier)) applied to it.getMatched(net.minecraft.text.Text input) LikegetMatched(String)but forTextinput.getMatcher(net.minecraft.util.Identifier id) Get anInlineMatcherby its IDgetRenderer(net.minecraft.util.Identifier id) Get anInlineRendererby its ID
-
Field Details
-
INSTANCE
-
-
Method Details
-
addRenderer
Register anInlineRenderer- Parameters:
renderer-
-
getRenderer
Get anInlineRendererby its ID- Parameters:
id-- Returns:
- renderer with the given id, or a
InlineErrorRendererif none could be found.
-
getAllRenderers
Set<InlineRenderer<?>> getAllRenderers()Get all registered renderers- Returns:
- all registered renderers
-
addMatcher
Register anInlineMatcher- Parameters:
matcher-
-
getMatcher
Get anInlineMatcherby its ID- Parameters:
id-- Returns:
- matcher with the given id, or null if it does not exist.
-
getAllMatchers
Set<InlineMatcher> getAllMatchers()Get all registered matchers- Returns:
- all registered matchers
-
getMatched
Gets a frozen/read-onlyMatchContextwith all currently enabled client-side matchers (seegetAllMatchers()andInlineClientConfig.isMatcherEnabled(net.minecraft.util.Identifier)) applied to it.This is backed by a cache for faster matching of repeated values. Since the returned MatchContexts are cached/re-used, it's likely that some of their operations (such as
MatchContext.getFinalMatches()orMatchContext.getFinalText()) will have already been ran and cached as well.- Parameters:
input- string to match against- Returns:
- read-only MatchContext with all currently enabled client-side matchers applied to it
-
getMatched
LikegetMatched(String)but forTextinput.- Parameters:
input- Text to match against- Returns:
- read-only MatchContext with all currently enabled client-side matchers applied to it
-
getConfig
InlineClientConfig getConfig()Get the client config.- Returns:
- inline client config.
-