@Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new dModListener(this), this);

        getCommand("leaderboard").setExecutor(new dModLeaderboard(this));
        getCommand("pvpreset").setExecutor(new dModPvpStat(this));
        getCommand("dmreload").setExecutor(this);

        if (new File(getDataFolder(), "config.yml").exists()) {
            try {
                if (getConfig().getInt("version") != 3) {
                    console.log(Level.WARNING, "dMod configuration file is out of date, resetting it.");
                    FileUtils.moveFile(getDataFolder() + "/config.yml", getDataFolder() + "/config.yml-old");
                    reloadConfig();
                    getConfig().options().copyDefaults(true);
                    getConfig().options().copyHeader(true);
                    saveConfig();
                }
            } catch (Exception e) {
                console.log(Level.SEVERE, e.getMessage());
                getServer().getPluginManager().disablePlugin(this);
                return;
            }
        } else {
            getConfig().options().copyDefaults(true);
            getConfig().options().copyHeader(true);
            saveConfig();
        }

//        if (getConfig().getBoolean("plugins.vault") == true) {
//            if (getServer().getPluginManager().getPlugin("Vault") != null) {
//                RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
//                if (economyProvider != null) {
//                    economy = economyProvider.getProvider();
//                    console.log(Level.INFO, MessageFormat.format("[dMod] Vault detected and using ''{0}''", economy.getName()));
//                } else {
//                    console.log(Level.INFO, "[dMod] Vault detected but no economy provider is available.");
//                }
//            } else {
//                console.log(Level.INFO, "[dMod] Vault not detected or available.");
//            }
//        }

        console.log(Level.INFO, MessageFormat.format("[dMod] PvP announcements is {0}", getConfig().getBoolean("pvp.announcements") ? "ON" : "OFF"));

        int lbReport = getConfig().getInt("pvp.leaderboard");
        lbReport = lbReport <= 0 ? 15 : lbReport;

        if (lbReport > 0) {
            getServer().getScheduler().scheduleSyncRepeatingTask(this, new dModTimedAnnounce(this), MININTICKS * lbReport, MININTICKS * lbReport);
        }

        int hours = getConfig().getInt("pvp.reset-stats");
        hours = hours <= 0 ? 24 : hours;
        if (hours > 0) {
            getServer().getScheduler().scheduleSyncRepeatingTask(this, new dModTimedReset(this), HOURINTICKS * hours, HOURINTICKS * hours);
        }

        try {
            MetricsLite metrics = new MetricsLite(this);
            metrics.start();
        } catch (IOException e) {
            console.log(Level.INFO, MessageFormat.format("[dMod] Metrics Error ''{0}''", e.getMessage()));
        }

        getServer().getScheduler().runTaskAsynchronously(this, new dModUpdate(this));
    }