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.

@FunctionalInterface public interface PlaceholderApplier
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 Type
    Method
    Description
    apply(@Nullable org.bukkit.entity.Player player, @Nullable String text)
    Applies placeholders to a single text fragment.
    default List<String>
    applyAll(@Nullable org.bukkit.entity.Player player, @Nullable List<String> texts)
    Applies placeholders to every entry of a list, preserving order and tolerating null entries.
  • Method Details

    • apply

      String apply(@Nullable @Nullable org.bukkit.entity.Player player, @Nullable @Nullable String text)
      Applies placeholders to a single text fragment.
      Parameters:
      player - the viewer whose context should resolve player-scoped placeholders; may be null when no specific player is in scope
      text - the text to process; may be null
      Returns:
      the processed text, or the original input if text is null
    • 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 tolerating null entries.
      Parameters:
      player - the viewer whose context should resolve player-scoped placeholders
      texts - the lines to process; may be null
      Returns:
      a fresh list with placeholders resolved, or null if texts is null