How-To: Hook Into AnfCore (For Developers)

Hooking into AnfCore:

There are several ways you can hook into a library, however the way I usually go about doing it is as follows: First off, inside of your 'plugin.yml', place 'depend: [AnfCore]', this will ensure that the plugin does not load without AnfCore loaded as well which would create errors. Next, you want to class class from AnfCore you wish to use (see AnfCore class list). Since most methods from AnfCore are static, they can simply (for example with BlockRow) be called by:

BlockRow.create(...);

//or (in some strange case)

new BlockRow.create(...);

These classes/methods are usually never called by AnfCore itself and as such you shouldn't run into any java exceptions.


Comments

Posts Quoted:
Reply
Clear All Quotes