Hooking

Dec 3, 2018
Hooking
  • How to hook with IvanACF

    Add the plugin as a dependency into your plugin.yml:
    Code (YAML):
    depend:
     - IvanACF
    Create a hook class:
    Code (Java):
    public class IvanACFHook extends ACFHook {

        public IvanACFHook(Plugin plugin) {
            super(plugin);
        }
    }
    Check everything properly into your onEnable:
    Code (Java):
        @Override
        public void onEnable(){
            if(getServer().getPluginManager().getPlugin("IvanACF") != null){
                new HandlerHook(this).hook();
                getLogger().info("Hooked into IvanACF");
            }else{
                getLogger().warning("IvanACF cannot be found, disabling...");
                getServer().getPluginManager().disablePlugin(this);
                return;
            }
            // your code comes here
        }
    Here's output if everything's properly setuped right and the plugin's running without problems:
    [​IMG]

    Thanks for using IvanACF !
  • Loading...
  • Loading...