public void onEnable() {


        this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
        this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new JPBungee());

        this.getConfig().options().copyDefaults(true);
        this.saveConfig();

        JumpPortsPlugin.logger = Logger.getLogger("Minecraft");
        JumpPortsPlugin.plugin = this;
        JumpPortsPlugin.pluginName = this.getDescription().getName();
        JumpPortsPlugin.pluginVersion = this.getDescription().getVersion();

        JumpPortsPlugin.lang = new Lang(this);

        if (getServer().getPluginManager().getPlugin("Vault") != null) {
            setupPermissions();
            setupEconomy();
        } else {
            log(ChatColor.RED
                    + "Missing dependency: Vault. Please install this for the plugin to work.");
            getServer().getPluginManager().disablePlugin(plugin);
            return;
        }

        if (getServer().getPluginManager().getPlugin("dynmap") != null) {
            setupDynmap();
        } else {
            log(ChatColor.RED + "Dynmap support disabled.");
        }

        // Create ports folder
        File theDir = new File(this.getDataFolder() + "/ports/"
                + File.separatorChar);

        // if the directory does not exist, create it
        if (!theDir.exists()) {
            boolean result = theDir.mkdir();
            if (result) {
                log("Ports folder created.");
            }
        }

        // Create players folder
        theDir = new File(this.getDataFolder() + "/players/"
                + File.separatorChar);

        // if the directory does not exist, create it
        if (!theDir.exists()) {
            boolean result = theDir.mkdir();
            if (result) {
                log("Players folder created.");
            }
        }

        setupCommands();

        PluginManager pm = getServer().getPluginManager();
        Listener events = new Events(this);
        pm.registerEvents(events, this);

        Listener RDEvents = new RDEvents();
        pm.registerEvents(RDEvents, this);
        RDPlayers.loadAll();
        JumpPorts.loadPorts();

        try {
            Metrics metrics = new Metrics(this);
            Graph graph = metrics.createGraph("Number of Ports");
            graph.addPlotter(new Metrics.Plotter("Ports") {
                @Override
                public int getValue() {
                    return JumpPorts.getList().size();
                }
            });

            metrics.start();
        } catch (IOException e) {
            // Failed to submit the stats :-(
        }

        JumpPortsPlugin.updater = new UpdateCheck(this, "http://dev.bukkit.org/server-mods/jumpports/files.rss");

        log(Lang.get("plugin.enabled"));
    }