@Override
    public void onEnable() {
        getConfig().options().copyDefaults(true);
        saveConfig();
        gm = new GameManager(this);
        lh = new LocationHandler(this);
        tm = new TeamManager(this);
        fm = new FlagManager(this);
        sm = new ScoreManager(this);
        sm.setupScoreboard();
        sm.setRedCaptures(0);
        sm.setBlueCaptures(0);
        sm.updateScoreboard();
        registerListeners(this, new AsyncPlayerChat(), new BlockListener(), new FoodLevelChange(),
                new InventoryClick(), new PlayerDropItem(), new PlayerDeath(), new PlayerJoin(),
                new PlayerQuit(), new EntityDamage(), new SignListener());
        getLogger().info("CTF has been enabled!");
        getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                if (fm.getRedFlagSpawn().getBlock().getType()!=Material.AIR) {
                    fm.getRedFlagSpawn().getWorld().playEffect(fm.getRedFlagSpawn(), Effect.MOBSPAWNER_FLAMES, 2004);
                }
            }
        }, 0L, 10L);
        getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                if (fm.getBlueFlagSpawn().getBlock().getType()!=Material.AIR) {
                    fm.getBlueFlagSpawn().getWorld().playEffect(fm.getBlueFlagSpawn(), Effect.MOBSPAWNER_FLAMES, 2004);
                }
            }
        }, 0L, 10L);
        getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                for (Player pl : getServer().getOnlinePlayers()) {
                    if (gm.isPlaying(pl)) {
                        if (fm.hasFlag(pl)) {
                            pl.getWorld().playEffect(pl.getLocation(), Effect.MOBSPAWNER_FLAMES, 2004);
                        }
                    }
                }
            }
        }, 0L, 10L);
    }