protected Enum<?> getConfigEnum(String world, String path, Enum<?> def) {
        String completePath = world + "." + path;
        try {
            if (!configSet(completePath, def.toString())) {
                String e = getConfigString(world, path, def.toString()).toUpperCase();
                if (def instanceof HeightLimitMode) {
                    return HeightLimitMode.valueOf(e);
                } else if (def instanceof WorldMode) {
                    return WorldMode.valueOf(e);
                } else {
                    return null;
                }
            } else {
                return def;
            }
        } catch (IllegalArgumentException iae) {
            AntiMobSpawn.instance().getLogger().severe("Unknown string detected in " + completePath + ". Please check your config file.");
            return null;
        }
    }