Hooking

Jan 28, 2019
Hooking
  • How to hook with IvanACF

    Add the plugin into your dependencies.
    If you use maven/gradle use this (works from version 1.6.0):
    Maven:
    HTML:
        <repositories>
            <repository>
                <id>sonatype</id>
                <url>https://oss.sonatype.org/content/groups/public/</url>
            </repository>
        </repositories>
    You can see the latest versions here and from there use the latest one.

    Add the plugin as a dependency into your plugin.yml:
    Code (YAML):
    depend:
     - IvanACF
    Create a check into your onEnable method
    Code (Java):
        @Override
        public void onEnable(){
            if(getServer().getPluginManager().getPlugin("IvanACF") != null){
                IvanACF.registerHook(this);
                getLogger().info("Hooked into IvanACF");
            }else{
                getLogger().warning("IvanACF cannot be found, disabling...");
                getServer().getPluginManager().disablePlugin(this);
                return;
            }
            // your code comes here
        }
    If you want you can use the ACFHook class, but its deprecated because you create a useless class just to told the plugin that you are depending the plugin for sure.

    Here's output if everything's properly setuped right and the plugin's running without problems:
    [​IMG]

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