List<DownloadInfo> list = Lists.newArrayList();
Boolean forceUpdate = Settings.getSettings().isForceUpdateEnabled();
File local;
//Pack JSON Libraries
Logger.logDebug("Checking pack libraries");
ModPack pack = ModPack.getSelectedPack();
File packDir = new File(installDir, pack.getDir());
File gameDir = new File(packDir, "minecraft");
File libDir = new File(installDir, "libraries");
// if (!pack.getDir().equals("mojang_vanilla")) {
if (!pack.getDir().equals("mojang_vanilla")) {
if (isLegacy) {
extractLegacyJson(new File(gameDir, "pack.json"));
}
}
if (new File(gameDir, "pack.json").exists()) {
Version packjson = JsonFactory.loadVersion(new File(gameDir, "pack.json"));
if (packjson.jar != null && !packjson.jar.isEmpty()) {
packmcversion = packjson.jar;
}
if (packjson.inheritsFrom != null && !packjson.inheritsFrom.isEmpty()) {
packbasejson = packjson.inheritsFrom;
}
Library.Artifact a;
for (Library lib : packjson.getLibraries()) {
//Logger.logError(new File(libDir, lib.getPath()).getAbsolutePath());
// These files are shipped inside pack.zip, can't do force update check yet
local = new File(root, "libraries/" + lib.getPath());
if (!new File(libDir, lib.getPath()).exists() || forceUpdate) {
if (lib.checksums != null) {
list.add(new DownloadInfo(new URL(lib.getUrl() + lib.getPath()), local, lib.getPath(), lib.checksums, "sha1",
DownloadInfo.DLType.NONE, DownloadInfo.DLType.NONE));
} else if (lib.download != null && lib.download) {
list.add(new DownloadInfo(new URL(lib.getUrl() + lib.getPath()), local, lib.getPath()));
}
}
a = lib.get_artifact();
if (a.getDomain().equalsIgnoreCase("net.minecraftforge") && (a.getName().equalsIgnoreCase("forge") || a.getName().equalsIgnoreCase("minecraftforge"))) {
grabJava8CompatFix(a, pack, packmcversion, installDir + "/" + pack.getDir());
}
}
//}
} else {
if (!pack.getDir().equals("mojang_vanilla")) {
Logger.logError("pack.json file not found-Forge/Liteloader will not be able to load!");
} else {
Logger.logInfo("pack.json not found in vanilla pack(this is expected)");
}
//TODO handle vanilla packs w/ tweakers w/ this stuffs !!!