Interface PlaceholderApplier
- All Known Implementing Classes:
NoopPlaceholderApplier,PapiPlaceholderApplier
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Resolves placeholder tokens in user-facing text (item display names, lore lines, titles).
When PlaceholderAPI is on the classpath,
InventoryApiAutoConfiguration installs
PapiPlaceholderApplier; otherwise NoopPlaceholderApplier, which returns the
input unchanged. Users can override either behavior by registering their own bean.
-
Method Summary
Modifier and TypeMethodDescriptionApplies placeholders to a single text fragment.Applies placeholders to every entry of a list, preserving order and toleratingnullentries.
-
Method Details
-
apply
Applies placeholders to a single text fragment.- Parameters:
player- the viewer whose context should resolve player-scoped placeholders; may benullwhen no specific player is in scopetext- the text to process; may benull- Returns:
- the processed text, or the original input if
textisnull
-
applyAll
default List<String> applyAll(@Nullable @Nullable org.bukkit.entity.Player player, @Nullable @Nullable List<String> texts) Applies placeholders to every entry of a list, preserving order and toleratingnullentries.- Parameters:
player- the viewer whose context should resolve player-scoped placeholderstexts- the lines to process; may benull- Returns:
- a fresh list with placeholders resolved, or
nulliftextsisnull
-