use of net.technicpack.minecraftcore.mojang.version.chain.ChainVersionBuilder in project LauncherV3 by TechnicPack.
the class Installer method createVersionBuilder.
private MojangVersionBuilder createVersionBuilder(ModpackModel modpack, InstallTasksQueue tasksQueue) {
ZipFileRetriever zipVersionRetriever = new ZipFileRetriever(new File(modpack.getBinDir(), "modpack.jar"));
HttpFileRetriever fallbackVersionRetriever = new HttpFileRetriever(TechnicConstants.technicVersions, tasksQueue.getDownloadListener());
ArrayList<MojangVersionRetriever> fallbackRetrievers = new ArrayList<MojangVersionRetriever>(1);
fallbackRetrievers.add(fallbackVersionRetriever);
File versionJson = new File(modpack.getBinDir(), "version.json");
// This always gets the version.json from the modpack.jar (it ignores "key"), cached as bin/version.json
FileVersionBuilder zipVersionBuilder = new FileVersionBuilder(versionJson, zipVersionRetriever, fallbackRetrievers);
// This gets the "key" from bin/$key.json if it exists, otherwise it downloads it from our repo into that location
FileVersionBuilder webVersionBuilder = new FileVersionBuilder(modpack.getBinDir(), null, fallbackRetrievers);
return new ChainVersionBuilder(zipVersionBuilder, webVersionBuilder);
}
Aggregations