mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2026-01-17 05:48:49 +01:00
Performance Improvements (#340)
* Performance Improvements * More Optimizations * Even More Optimizations & Cleanups * Almost a recode I guess
This commit is contained in:
@@ -20,13 +20,14 @@
|
||||
*/
|
||||
package me.clip.placeholderapi;
|
||||
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.expansion.Relational;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public abstract class PlaceholderHook {
|
||||
|
||||
/**
|
||||
* called when a placeholder value is requested from this hook
|
||||
* Called when a placeholder value is requested from this hook.
|
||||
*
|
||||
* @param player {@link OfflinePlayer} to request the placeholder value for, null if not needed for a
|
||||
* player
|
||||
@@ -41,8 +42,12 @@ public abstract class PlaceholderHook {
|
||||
return onPlaceholderRequest(null, params);
|
||||
}
|
||||
|
||||
public PlaceholderAPIPlugin getPlaceholderAPI() {
|
||||
return PlaceholderAPIPlugin.getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* called when a placeholder is requested from this hook
|
||||
* Called when a placeholder is requested from this hook.
|
||||
*
|
||||
* @param player {@link Player} to request the placeholder value for, null if not needed for a player
|
||||
* @param params String passed to the hook to determine what value to return
|
||||
@@ -51,4 +56,12 @@ public abstract class PlaceholderHook {
|
||||
public String onPlaceholderRequest(Player player, String params) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isExpansion() {
|
||||
return this instanceof PlaceholderExpansion;
|
||||
}
|
||||
|
||||
public boolean isRelational() {
|
||||
return this instanceof Relational;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user