@Override
    public void onEnable() {
        instance = this;
        c = new Config(this);
        if (Config.defaultConfig) {
            getLogger().warning("RoyalIRC is disabled until the config is edited.");
            setEnabled(false);
            return;
        }
        version = getDescription().getVersion();
        bh = new BotHandler(this);
        bh.createBots();

        final PluginManager pm = getServer().getPluginManager();
        pm.registerEvents(new BChatListener(this), this);
        pm.registerEvents(new BServerListener(this), this);

        getCommand("royalirc").setExecutor(new CmdRoyalIRC(this));
        getCommand("ircmessage").setExecutor(new CmdIRCMessage(this));
        getCommand("irckick").setExecutor(new CmdIRCKick(this));
        getCommand("ircrestartbots").setExecutor(new CmdIRCRestartBots(this));

        //-- Hidendra's Metrics --//

        try {
            Matcher matcher = versionPattern.matcher(version);
            matcher.matches();
            // 1 = base version
            // 2 = -SNAPSHOT
            // 5 = build #
            String versionMinusBuild = (matcher.group(1) == null) ? "Unknown" : matcher.group(1);
            String build = (matcher.group(5) == null) ? "local build" : matcher.group(5);
            if (matcher.group(2) == null) build = "release";
            final Metrics m = new Metrics(this);
            Metrics.Graph g = m.createGraph("Version"); // get our custom version graph
            g.addPlotter(
                    new Metrics.Plotter(versionMinusBuild + "~=~" + build) {
                        @Override
                        public int getValue() {
                            return 1; // this value doesn't matter
                        }
                    }
            ); // add the donut graph with major version inside and build outside
            m.addGraph(g); // add the graph
            if (!m.start())
                getLogger().info("You have Metrics off! I like to keep accurate usage statistics, but okay. :(");
            else getLogger().info("Metrics enabled. Thank you!");
        } catch (Exception ignore) {
            getLogger().warning("Could not start Metrics!");
        }
    }