<commit_before>package tk.martijn_heil.kingdomessentials.playerclass.hooks;


import me.clip.placeholderapi.PlaceholderAPI;
import me.clip.placeholderapi.external.EZPlaceholderHook;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import tk.martijn_heil.kingdomessentials.playerclass.ModPlayerClass;
import tk.martijn_heil.kingdomessentials.playerclass.model.COnlinePlayer;

public class PlaceHolderApiHook
{
    private boolean usePlaceHolderApi;


    public PlaceHolderApiHook()
    {
        if (Bukkit.getPluginManager().isPluginEnabled("PlaceHolderAPI"))
        {
            ModPlayerClass.getInstance().getNinLogger().info("PlaceHolderAPI detected! Hooking in.");
            this.usePlaceHolderApi = true;
            new Hook(ModPlayerClass.getInstance());
        }
    }


    public String parse(Player p, String s)
    {
        return (this.usePlaceHolderApi) ? PlaceholderAPI.setPlaceholders(p, s) : s;
    }


    private class Hook extends EZPlaceholderHook
    {
        public Hook(Plugin plugin)
        {
            super(plugin, "kingdomess");
        }<commit_msg>Fix PlaceholderAPI not being detected due to incorrect casing<commit_after>package tk.martijn_heil.kingdomessentials.playerclass.hooks;


import me.clip.placeholderapi.PlaceholderAPI;
import me.clip.placeholderapi.external.EZPlaceholderHook;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import tk.martijn_heil.kingdomessentials.playerclass.ModPlayerClass;
import tk.martijn_heil.kingdomessentials.playerclass.model.COnlinePlayer;

public class PlaceHolderApiHook
{
    private boolean usePlaceHolderApi;


    public PlaceHolderApiHook()
    {
        if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI"))
        {
            ModPlayerClass.getInstance().getNinLogger().info("PlaceholderAPI detected! Hooking in.");
            this.usePlaceHolderApi = true;
            new Hook(ModPlayerClass.getInstance());
        }
    }


    public String parse(Player p, String s)
    {
        return (this.usePlaceHolderApi) ? PlaceholderAPI.setPlaceholders(p, s) : s;
    }


    private class Hook extends EZPlaceholderHook
    {
        public Hook(Plugin plugin)
        {
            super(plugin, "kingdomess");
        }
{'fraction_non_alphanumeric': 0.09161624891961971, 'fraction_numerical': 0.0, 'mean_word_length': 3.4777562862669247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2898624', 'n_tokens_mistral': 692, 'n_tokens_neox': 669, 'n_words': 118}