public static String getTechnicFolder() {
        if (INSTANCE.versionData.getNode("install").getBooleanValue("technicFolder", "automatic")) {
           File jarPath = new File(Minecraft.class.getProtectionDomain().getCodeSource().getLocation().getPath());
           return jarPath.getParentFile().getParentFile().getParentFile().getPath();
        } else {
            String osType = System.getProperty("os.name").toLowerCase();
            String userHomeDir = System.getProperty("user.home", ".");
            File result;
            JsonNode technicFolder = INSTANCE.versionData.getNode("install").getNode("technicFolder");
            if (osType.contains("win")) {
                if (technicFolder.getStringValue("windows").equals("default")) {
                    if (System.getenv("APPDATA") != null) {
                        result = new File(System.getenv("APPDATA"), ".technic");
                    } else {
                        result = new File(userHomeDir, ".technic");
                    }
                } else {
                    result = new File(technicFolder.getStringValue("windows"));
                }
            } else if (osType.contains("mac")) {
                if (technicFolder.getStringValue("mac").equals("default")) {
                    result = new File(new File(new File(userHomeDir, "Library"), "Application Support"), "technic");
                } else {
                    result = new File(technicFolder.getStringValue("mac"));
                }
            } else {
                if (technicFolder.getStringValue("linux").equals("default")) {
                    result = new File(userHomeDir, ".technic");
                } else {
                    result = new File(technicFolder.getStringValue("linux"));
                }
            }

            return result.getPath();
        }
    }