diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-04-13 09:28:25 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-13 09:28:25 +0200 |
commit | be53eb66f8a63730f4def5640db6205678b4e9d8 (patch) | |
tree | bd5bdef96985312b6687b40f8835336bb3f56bb3 /api/logic/minecraft/onesix/update | |
parent | db7357d008ae1f4ac0599b7e410ab666dbea5805 (diff) | |
download | PrismLauncher-be53eb66f8a63730f4def5640db6205678b4e9d8.tar.gz PrismLauncher-be53eb66f8a63730f4def5640db6205678b4e9d8.tar.bz2 PrismLauncher-be53eb66f8a63730f4def5640db6205678b4e9d8.zip |
NOISSUE implement mainJar support in OneSix format
This allows customizing the main jar like any other library.
Diffstat (limited to 'api/logic/minecraft/onesix/update')
-rw-r--r-- | api/logic/minecraft/onesix/update/LibrariesTask.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/api/logic/minecraft/onesix/update/LibrariesTask.cpp b/api/logic/minecraft/onesix/update/LibrariesTask.cpp index 3e6bb12a..1b7e71d3 100644 --- a/api/logic/minecraft/onesix/update/LibrariesTask.cpp +++ b/api/logic/minecraft/onesix/update/LibrariesTask.cpp @@ -21,36 +21,36 @@ void LibrariesTask::executeTask() // Build a list of URLs that will need to be downloaded. std::shared_ptr<MinecraftProfile> profile = inst->getMinecraftProfile(); - // minecraft.jar for this version - { - QString version_id = profile->getMinecraftVersion(); - QString localPath = version_id + "/" + version_id + ".jar"; - QString urlstr = profile->getMainJarUrl(); - - auto job = new NetJob(tr("Libraries for instance %1").arg(inst->name())); - auto metacache = ENV.metacache(); - auto entry = metacache->resolveEntry("versions", localPath); - job->addNetAction(Net::Download::makeCached(QUrl(urlstr), entry)); - downloadJob.reset(job); - } + auto job = new NetJob(tr("Libraries for instance %1").arg(inst->name())); + downloadJob.reset(job); auto metacache = ENV.metacache(); QList<LibraryPtr> brokenLocalLibs; QStringList failedFiles; + auto createJob = [&](const LibraryPtr & lib) + { + if(!lib) + { + emitFailed(tr("Null jar is specified in the metadata, aborting.")); + return; + } + auto dls = lib->getDownloads(currentSystem, metacache.get(), failedFiles, inst->getLocalLibraryPath()); + for(auto dl : dls) + { + downloadJob->addNetAction(dl); + } + }; auto createJobs = [&](const QList<LibraryPtr> & libs) { for (auto lib : libs) { - auto dls = lib->getDownloads(currentSystem, metacache.get(), failedFiles, inst->getLocalLibraryPath()); - for(auto dl : dls) - { - downloadJob->addNetAction(dl); - } + createJob(lib); } }; createJobs(profile->getLibraries()); createJobs(profile->getNativeLibraries()); + createJob(profile->getMainJar()); // FIXME: this is never filled!!!! if (!brokenLocalLibs.empty()) |