Interface PlaceholderResolver

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 PlaceholderResolver
Supplies the values of one addon's placeholders.

Called whenever one of the addon's placeholders is rendered, on whatever thread renders it - usually the main thread, but not always - so it must be cheap and thread-safe. A resolver that throws renders nothing for that placeholder; it never breaks the text around it.

Since:
1.8.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
    resolve(@Nullable org.bukkit.OfflinePlayer player, @NotNull String key)
     
  • Method Details

    • resolve

      @Nullable @Nullable String resolve(@Nullable @Nullable org.bukkit.OfflinePlayer player, @NotNull @NotNull String key)
      Parameters:
      player - the player the text is rendered for, or null when there is none
      key - the part after namespace:, lowercase, such as "kills" for %zentrix_myaddon:kills%
      Returns:
      the value, or null when the key is not one of the addon's placeholders