Do not make *PlaceholderReplacementSupplier extend *Placeholder

This commit is contained in:
filoghost 2021-09-25 12:38:35 +02:00
parent 6f6a214ecd
commit 8a80c063b7
4 changed files with 28 additions and 8 deletions

View File

@ -5,9 +5,23 @@
*/
package me.filoghost.holographicdisplays.api.placeholder;
import org.jetbrains.annotations.Nullable;
/**
* @since 1
*/
public interface GlobalPlaceholder extends GlobalPlaceholderReplacementSupplier, Placeholder {
public interface GlobalPlaceholder extends Placeholder {
/**
* Callback for providing a placeholder replacement, given the argument of the placeholder (if present).
* <p>
* For example, the argument of {test} is null, the argument of {test: hello world} is the string "hello world".
* <p>
* <b>Warning</b>: this method should be performance efficient, as it may be invoked often.
*
* @return the placeholder replacement
* @since 1
*/
@Nullable String getReplacement(@Nullable String argument);
}

View File

@ -16,13 +16,8 @@ import org.jetbrains.annotations.Nullable;
public interface GlobalPlaceholderReplacementSupplier {
/**
* Callback for providing a placeholder replacement, given the argument of the placeholder (if present).
* <p>
* For example, the argument of {test} is null, the argument of {test: hello world} is the string "hello world".
* <p>
* <b>Warning</b>: this method should be performance efficient, as it may be invoked often.
* @see GlobalPlaceholder#getReplacement(String)
*
* @return the placeholder replacement
* @since 1
*/
@Nullable String getReplacement(@Nullable String argument);

View File

@ -5,9 +5,18 @@
*/
package me.filoghost.holographicdisplays.api.placeholder;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @since 1
*/
public interface IndividualPlaceholder extends IndividualPlaceholderReplacementSupplier, Placeholder {
public interface IndividualPlaceholder extends Placeholder {
/**
* @since 1
*/
@Nullable String getReplacement(@NotNull Player player, @Nullable String argument);
}

View File

@ -16,6 +16,8 @@ import org.jetbrains.annotations.Nullable;
public interface IndividualPlaceholderReplacementSupplier {
/**
* @see IndividualPlaceholder#getReplacement(Player, String)
*
* @since 1
*/
@Nullable String getReplacement(@NotNull Player player, @Nullable String argument);