-
Notifications
You must be signed in to change notification settings - Fork 0
Plugin API
Sam Jakob Mearns edited this page Jun 10, 2019
·
1 revision
- Your main class should extend
VerdigrisPluginBaseand should be annotated with@VerdigrisPlugin. - Your main class must contain an
#onEnablemethod that returns true. Even if theonEnablemethod itself is empty. - You should do your best to make sure the package name of your plugin does not conflict with another. A safe bet is
com.mydomain.myproject. If in doubt, just useio.github.<username>.myproject
Should you need to log information to the console, it's recommended that you use the PluginLogger. You can get your plugin's PluginLogger with #getLogger() in your plugin's main class.
package com.samjakob.verdigris.test;
import com.cloutteam.jarcraftinator.plugin.api.VerdigrisPlugin;
import com.cloutteam.jarcraftinator.plugin.api.VerdigrisPluginBase;
@VerdigrisPlugin(
name = "TestPlugin",
version = "1.0.0",
author = "SamJakob",
description = "A test plugin for Verdigris."
)
public class TestPlugin extends VerdigrisPluginBase {
@Override
public boolean onEnable() {
getLogger().log("Hello world!");
return true;
}
}This is the log produced from that plugin running on Verdigris.
[2019-06-10 22:33:38] [INFO] Logger ready!
[2019-06-10 22:33:38] [INFO] Loading settings...
...
[2019-06-10 22:33:39] [INFO] [TestPlugin] Enabling TestPlugin v1.0.0 by SamJakob.
[2019-06-10 22:33:39] [INFO] [TestPlugin] Hello world!
[2019-06-10 22:33:39] [INFO] [TestPlugin] Enabled TestPlugin v1.0.0 by SamJakob.