@Override
    public void onEnable() {
        config = new Config(this);
        config.loadConfig();

        getServer().getPluginManager().registerEvents(new BlockBreakListener(this), this);
        getServer().getPluginManager().registerEvents(new BlockPlaceListener(this), this);
        getServer().getPluginManager().registerEvents(new PistonListener(this), this);

        CommandHandler commandHandler = new CommandHandler(this, "ob");
        commandHandler.register(new Command("clear", "Clears blacklisted blocks", "ob.commands.clear") {
            @Override
            public void execute(CommandSender sender, List<String> args) {
                int size = clearBlackList();
                sender.sendMessage(size + " block" + (size > 1 ? "s" : "")  + " cleared...");
            }
        });

        commandHandler.register(new Command("reload", "Reloads OreBroadcast config", "ob.commands.reload") {
            @Override
            public void execute(CommandSender sender, List<String> args) {
                config.loadConfig();
                sender.sendMessage("Config reloaded...");
            }
        });

        commandHandler.register(new Command("update", "Checks/Updates OreBroadcast version - Usage: update <check|update>", "ob.commands.update") {
            @Override
            public void execute(CommandSender sender, List<String> args) {
                if(args.size() < 1) {
                    sender.sendMessage("Not enough arguments");
                    return;
                }
                if(config.getUpdater().isUpdated()) {
                    sender.sendMessage("An update has already been downloaded, restart the server to apply it");
                    return;
                }

                if(args.get(0).equalsIgnoreCase("check")) {
                    config.getUpdater().checkUpdate(sender, false);
                    if(config.getUpdater().isUpdateAvailable()) {
                        sender.sendMessage("Update available");
                    } else {
                        sender.sendMessage("No update available");
                    }
                    return;
                }

                if(args.get(0).equalsIgnoreCase("download")) {
                    config.getUpdater().checkUpdate(sender, true);
                }
            }
        });

        commandHandler.register(new Command("optout", "Toggles OreBroadcast messages for yourself", "ob.commands.optout") {
            @Override
            public void execute(CommandSender sender, List<String> args) {
                if(!(sender instanceof Player)) {
                    sender.sendMessage(ChatColor.RED + "Only players can optout");
                    return;
                }
                UUID uuid = ((Player) sender).getUniqueId();
                if(config.isOptOut(uuid)) {
                    config.unOptOutPlayer(uuid);
                    sender.sendMessage("You will now receive the ore broadcasts");
                } else {
                    config.optOutPlayer(uuid);
                    sender.sendMessage("You won't receive ore broadcasts anymore");
                }
            }
        });
    }