Performance Improvements (#340)

* Performance Improvements

* More Optimizations

* Even More Optimizations & Cleanups

* Almost a recode I guess
This commit is contained in:
Crypto Morin
2020-07-16 09:32:22 -07:00
committed by GitHub
parent f9f59f1f96
commit 54d5757d0a
52 changed files with 876 additions and 875 deletions

View File

@@ -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;
}
}