package pw.ian.albkit;

import org.bukkit.Server;
import org.bukkit.event.Listener;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.ServicesManager;
import org.bukkit.plugin.java.JavaPlugin;

/**
 * A base plugin class which makes creating new plugins more convenient, as it
 * removes the necessity to initialise server, plugin manager and services
 * manager variables as well as providing an easy way to register listeners
 *
 * @author Ollie
 */
public abstract class AlbPlugin extends JavaPlugin {

    protected Server server;

    protected PluginManager pluginMgr;

    protected ServicesManager servicesMgr;

    public abstract void onEnable();

    /**
     * Initialises variables etc for this plugin. Should be called at the start
     * of the onEnable() implementation in extensions of this class
     */
    protected void init() {
        server = getServer();
        pluginMgr = server.getPluginManager();
        servicesMgr = server.getServicesManager();
    }

    /**
     * Registers the given listener to this JavaPlugin object
     *
     * @param listener The Listener to register
     */
    protected void register(final Listener listener) {
        pluginMgr.registerEvents(listener, this);
    }

}

@@ -17,16 +17,101 @@
 lbkit;%0A%0A
+import pw.ian.albkit.command.CommandHandler;%0Aimport pw.ian.albkit.command.Commands;%0A%0A
 import o
@@ -1323,10 +1323,607 @@
 %0A    %7D%0A%0A
+    /**%0A     * Registers the given CommandHandler to a command with the given name%0A     *%0A     * @param name    The name to register the command to%0A     * @param handler The CommandHandler to register for the command%0A     */%0A    protected void register(final String name, final CommandHandler handler) %7B%0A        Commands.registerCommand(this, name, handler);%0A    %7D%0A%0A    /**%0A     * Registers the given CommandHandler%0A     *%0A     * @param handler The CommandHandler to register%0A     */%0A    protected void register(final CommandHandler handler) %7B%0A        register(handler.getName(), handler);%0A    %7D%0A%0A
 %7D%0A

Add utility command registration methods