Skip to content

Hooking into Caliburn

Daniel Saukel edited this page Aug 12, 2018 · 1 revision

Getting started

Caliburn can be fetched from the Maven repository. The direct link for a jar download is

http://erethon.de/repo/de/erethon/caliburn/{version}/caliburn-{version}.jar

Depending on your needs, it may be appropriate to either implement Caliburn in your own plugin or two make use of an existing implementation.

Creating a custom implementation of Caliburn

2. Initialize CaliburnAPI

This can easily be done by creating a new instance of de.erethon.caliburn.CaliburnAPI.

The static getter de.erethon.caliburn.CaliburnAPI.getInstance() always returns

    private CaliburnAPI caliburn;

    @Override
    public void onEnable() {
        caliburn = CaliburnAPI.getInstance() == null ? new CaliburnAPI(this) : CaliburnAPI.getInstance();
    }

Using an existing implementation as a dynamic dependency

ItemsXL is an official, slim implementation of CaliburnAPI as a plugin. That being said, you do not need to shade Caliburn if you run ItemsXL on your server. Just make sure to add it as a hard dependency to your plugin.yml.

depend: [ItemsXL]

ItemsXL handles the initialization of the API, so the static getter de.erethon.caliburn.CaliburnAPI.getInstance() can safely be used.