public static String getIDFromConfig(String mode, String setting) {

        JSONArray modsArray = (JSONArray) IDConfig.get(mode);

        if (modsArray != null) {
            for (Object obj : modsArray.toArray()) {
                JSONObject mod = (JSONObject) obj;
                String modname = (String) mod.get("name");
                if (setting.contains(modname)) {
                    int rangeStart = Integer.parseInt((String) mod.get("range"));
                    int bump = 0;
                    if (IDRanges.containsKey(modname)) {
                        bump = IDRanges.get(modname);
                    }
                    IDRanges.put(modname, bump + 1);
                    return Integer.toString(rangeStart + bump);
                }
            }
        }

        return null;
    }