Interface InlineClientAPI
public interface InlineClientAPI
The main Inline Client API. Primarly for managing matchers and renderers.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMatcher
(InlineMatcher matcher) Register anInlineMatcher
void
addRenderer
(InlineRenderer<?> renderer) Register anInlineRenderer
Get all registered matchersSet<InlineRenderer<?>>
Get all registered renderersGet the client config.getMatched
(String input) Gets a frozen/read-onlyMatchContext
with 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 forText
input.getMatcher
(net.minecraft.util.Identifier id) Get anInlineMatcher
by its IDgetRenderer
(net.minecraft.util.Identifier id) Get anInlineRenderer
by its ID
-
Field Details
-
INSTANCE
-
-
Method Details
-
addRenderer
Register anInlineRenderer
- Parameters:
renderer
-
-
getRenderer
Get anInlineRenderer
by its ID- Parameters:
id
-- Returns:
- renderer with the given id, or a
InlineErrorRenderer
if none could be found.
-
getAllRenderers
Set<InlineRenderer<?>> getAllRenderers()Get all registered renderers- Returns:
- all registered renderers
-
addMatcher
Register anInlineMatcher
- Parameters:
matcher
-
-
getMatcher
Get anInlineMatcher
by 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-onlyMatchContext
with 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 forText
input.- 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.
-