@SuppressWarnings("unchecked")
    public static void setup() {
        worlds = (ArrayList<String>) config.get(cfgAllowedWorlds);

        if (worlds == null) {
            worlds = new ArrayList<String>();
            worlds.add("testworld");
            worlds.add("testworld2");
            config.set(cfgAllowedWorlds, worlds);
        }

        // Handle old versions of the plugin by moving the explosion damage.
        double dmg = config.getDouble(cfgExplosionDamage, -1);
        if (dmg != -1) {
            config.set(cfgDieExplosionPower, dmg);
            config.set(cfgDyeExplosionPower, dmg);
            config.set(cfgExplosionDamage, null);
        }

        config.addDefault(cfgDropWool, DROP_WOOL_DEFAULT);
        config.addDefault(cfgShearType, TYPE_WOLF);
        config.addDefault(cfgShearExplosionPower, DEFAULT_EXPLOSION_POWER);
        config.addDefault(cfgDieType, TYPE_EXPLOSION);
        config.addDefault(cfgDieExplosionPower, DEFAULT_EXPLOSION_POWER);
        config.addDefault(cfgDyeType, TYPE_EXPLOSION);
        config.addDefault(cfgDyeExplosionPower, DEFAULT_EXPLOSION_POWER);

        if (!config.isSet(cfgDropWool) || !config.isSet(cfgShearType) || !config.isSet(cfgShearExplosionPower)
         || !config.isSet(cfgDieType) || !config.isSet(cfgDieExplosionPower) || !config.isSet(cfgDyeType) || !config.isSet(cfgDyeExplosionPower)) {
            config.options().copyDefaults(true);
        }
        saveConfig();
    }