This commit is contained in:
PiggyPiglet
2025-10-25 12:33:16 +08:00
parent f14b081f0b
commit 683dc6e8e3
4 changed files with 244 additions and 1 deletions

View File

@@ -20,11 +20,14 @@
package me.clip.placeholderapi;
import net.kyori.adventure.text.Component;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Optional;
public abstract class PlaceholderHook {
@Nullable
public String onRequest(final OfflinePlayer player, @NotNull final String params) {
@@ -35,8 +38,16 @@ public abstract class PlaceholderHook {
return onPlaceholderRequest(null, params);
}
@Deprecated
@Nullable
public String onPlaceholderRequest(final Player player, @NotNull final String params) {
return null;
}
@Nullable
public Component onPlaceholderComponentRequest(final Player player, @NotNull final String params) {
final String result = onPlaceholderRequest(player, params);
return result == null ? null : Component.text(result);
}
}