Interface PlaceholderManager<E>
- All Known Implementing Classes:
PlaceholderModuleManager,SpigotPlaceholderManager
public interface PlaceholderManager<E>
-
Method Summary
Modifier and TypeMethodDescriptionvoidregister(@NotNull PlaceholderModule<E> module) Register a module that provides placeholders.net.kyori.adventure.text.Componentreplace(@NotNull String text, @NotNull PlaceholderResolveContext<E> context) Replace placeholders.default net.kyori.adventure.text.ComponentReplace placeholders with the given entity as context.net.kyori.adventure.text.Componentreplace(@NotNull net.kyori.adventure.text.Component component, @NotNull PlaceholderResolveContext<E> context) Replace placeholders.default net.kyori.adventure.text.ComponentReplace placeholders with the given entity as context.@Nullable net.kyori.adventure.text.Componentresolve(@NotNull String placeholder, @NotNull PlaceholderResolveContext<E> context) Resolve the placeholder replacement for the given context.default @Nullable net.kyori.adventure.text.ComponentResolve the placeholder replacement for the given entity as context.voidunregister(@NotNull PlaceholderModule<E> module) Unregister a placeholder module
-
Method Details
-
replace
net.kyori.adventure.text.Component replace(@NotNull @NotNull net.kyori.adventure.text.Component component, @NotNull @NotNull PlaceholderResolveContext<E> context) Replace placeholders.- Parameters:
component- to replace placeholders in- Returns:
- the component with placeholders replaced
-
replace
default net.kyori.adventure.text.Component replace(@NotNull @NotNull net.kyori.adventure.text.Component component, @NotNull E entity) Replace placeholders with the given entity as context.- Parameters:
entity- for whom to replace placeholderscomponent- to replace placeholders in- Returns:
- the component with placeholders replaced
-
replace
net.kyori.adventure.text.Component replace(@NotNull @NotNull String text, @NotNull @NotNull PlaceholderResolveContext<E> context) Replace placeholders.- Parameters:
text- to replace placeholders in- Returns:
- the component with placeholders replaced
-
replace
default net.kyori.adventure.text.Component replace(@NotNull @NotNull String text, @NotNull E entity) Replace placeholders with the given entity as context.- Parameters:
entity- for whom to replace placeholderstext- to replace placeholders in- Returns:
- the component with placeholders replaced
-
resolve
@Nullable @Nullable net.kyori.adventure.text.Component resolve(@NotNull @NotNull String placeholder, @NotNull @NotNull PlaceholderResolveContext<E> context) Resolve the placeholder replacement for the given context.- Returns:
- the replacement.
-
resolve
@Nullable default @Nullable net.kyori.adventure.text.Component resolve(@NotNull @NotNull String placeholder, @NotNull E entity) Resolve the placeholder replacement for the given entity as context.- Parameters:
entity- for whom to replace placeholders.placeholder- the placeholder to replace- Returns:
- the replacement.
-
register
Register a module that provides placeholders.- Parameters:
module- the module to register
-
unregister
Unregister a placeholder module- Parameters:
module- the module to unregister.
-