API (Developers)
Every useful plugin has its own API. Without any information, though, an API isn't perfect.
Hooking into SimpleRegister
Hooking into SimpleRegister is fairly simple.
First, add SimpleRegister to your plugin's library.
To get to the API class, you have to call the method 'getInstance'.
Example:
if (getServer().getPluginManager().getPlugin("Simple Register") != null) { SimpleRegister SimpleRegister = (SimpleRegister) getServer().getPluginManager().getPlugin("Simple Register"); // Get the API Class API SimpleRegisterAPI = SimpleRegister.getInstance(); // Further methods.... } else { // TODO: SimpleRegister is not found, do code here. }
You're all set now. You can do anything you want!
Listening to Events
SimpleRegister has 2 events as of version 1.6. AcceptApplicationEvent is fired when a player accepts an application, and DeclineApplicationEvent.. you can probably guess
Example for AcceptApplicationEvent:
@EventHandler public void acceptEvent(AcceptApplicationEvent event) { // TODO: Do you stuff here! }
Example for DeclineApplicationEvent:
@EventHandler public void declineEvent(DeclineApplicationEvent event) { // TODO: Do you stuff here! }
Comments