Interface IndividualPlaceholderFactory


public interface IndividualPlaceholderFactory
Advanced class to create separate IndividualPlaceholder instances depending on the placeholder argument, instead of providing a single one when registering the placeholder.

This is mostly used for performance reasons, to parse the argument only when necessary, instead of doing it every time the method IndividualPlaceholder.getReplacement(Player, String) is invoked. For example, the argument might consist of multiple comma-separated values, be a JSON string, or require a regular expression to parse it.

Another less common use case is to keep a separate internal state for each different argument.

Since:
1
  • Method Summary

    Modifier and Type
    Method
    Description
    getPlaceholder(@Nullable String argument)
    Returns the placeholder instance to provide the replacement for the given argument.
  • Method Details

    • getPlaceholder

      @Nullable @Nullable IndividualPlaceholder getPlaceholder(@Nullable @Nullable String argument)
      Returns the placeholder instance to provide the replacement for the given argument. This method might be invoked again for the same argument if the placeholder is temporarily unused (not displayed to any player).
      Parameters:
      argument - the argument for which the placeholder instance will provide the replacement
      Returns:
      the placeholder instance
      Since:
      1