public boolean hook() { return PlaceholderAPI.registerPlaceholderHook(identifier, this); }
@Override public void init(OCMMain plugin){ System.out.println("Registering hook..."); PlaceholderAPI.registerPlaceholderHook("ocm", new PlaceholderHook() { @Override public String onPlaceholderRequest(Player player, String identifier){ System.out.println("Hook called for " + player.getName() + " with identifier '" + identifier + "'"); if(identifier.equals("pvp_mode")){ return ModuleAttackCooldown.getPVPMode(player).getName(); } return null; } }); } }
@Deprecated public static boolean registerPlaceholderHook(Plugin plugin, PlaceholderHook placeholderHook) { return plugin != null && registerPlaceholderHook(plugin.getName(), placeholderHook); }
public PlaceholderAPIManager(MageController controller) { this.controller = controller; if (!PlaceholderAPI.registerPlaceholderHook("magic", this)) { controller.getLogger().warning("PlaceholderAPI integration failed"); } else { controller.getLogger().info("PlaceholderAPI integration enabled. Available placeholders:"); controller.getLogger().info("magic_path, magic_class, magic_wand, magic_spell"); } }
public static boolean registerExpansion(PlaceholderExpansion ex) { if (registerPlaceholderHook(ex.getIdentifier(), ex)) { Bukkit.getPluginManager().callEvent(new ExpansionRegisterEvent(ex)); return true; } return false; }