diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-07-06 11:15:15 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-07-06 11:15:15 +0200 |
commit | cc499488dbab9167870e6088f9a1793f95894c79 (patch) | |
tree | d6efb25086f4c2c6cb3c0a3dc8ad5a5a80985286 /logic/liteloader | |
parent | a218d7b7f6a9e30671be72b756104302637eb33d (diff) | |
download | MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar.gz MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar.lz MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar.xz MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.zip |
Fix liteloader, some cleanups.
Diffstat (limited to 'logic/liteloader')
-rw-r--r-- | logic/liteloader/LiteLoaderInstaller.cpp | 9 | ||||
-rw-r--r-- | logic/liteloader/LiteLoaderVersionList.cpp | 17 | ||||
-rw-r--r-- | logic/liteloader/LiteLoaderVersionList.h | 3 |
3 files changed, 22 insertions, 7 deletions
diff --git a/logic/liteloader/LiteLoaderInstaller.cpp b/logic/liteloader/LiteLoaderInstaller.cpp index ea1a4396..863c7fcb 100644 --- a/logic/liteloader/LiteLoaderInstaller.cpp +++ b/logic/liteloader/LiteLoaderInstaller.cpp @@ -49,13 +49,12 @@ bool LiteLoaderInstaller::add(OneSixInstance *to) QJsonArray libraries; - for (auto libStr : m_version->libraries) + for (auto rawLibrary : m_version->libraries) { - OneSixLibrary lib(libStr); + rawLibrary->insertType = RawLibrary::Prepend; + OneSixLibrary lib(rawLibrary); lib.finalize(); - QJsonObject libObj = lib.toJson(); - libObj.insert("insert", QString("prepend")); - libraries.append(libObj); + libraries.append(lib.toJson()); } // liteloader diff --git a/logic/liteloader/LiteLoaderVersionList.cpp b/logic/liteloader/LiteLoaderVersionList.cpp index ef95eefd..c9a21cb9 100644 --- a/logic/liteloader/LiteLoaderVersionList.cpp +++ b/logic/liteloader/LiteLoaderVersionList.cpp @@ -16,6 +16,7 @@ #include "LiteLoaderVersionList.h" #include "MultiMC.h" #include "logic/net/URLConstants.h" +#include <MMCError.h> #include <QtXml> @@ -206,7 +207,21 @@ void LLListLoadTask::listDownloaded() const QJsonArray libs = artefact.value("libraries").toArray(); for (auto lIt = libs.begin(); lIt != libs.end(); ++lIt) { - version->libraries.append((*lIt).toObject().value("name").toString()); + auto libobject = (*lIt).toObject(); + try + { + auto lib = RawLibrary::fromJson(libobject, "versions.json"); + if(lib->m_name.startsWith("org.ow2.asm:asm-all:")) + { + lib->m_base_url = "http://repo.maven.apache.org/maven2/"; + } + version->libraries.append(lib); + } + catch (MMCError &e) + { + QLOG_ERROR() << "Couldn't read JSON object:"; + continue; + } } perMcVersionList.append(version); } diff --git a/logic/liteloader/LiteLoaderVersionList.h b/logic/liteloader/LiteLoaderVersionList.h index 0aecc3e1..91ed077c 100644 --- a/logic/liteloader/LiteLoaderVersionList.h +++ b/logic/liteloader/LiteLoaderVersionList.h @@ -23,6 +23,7 @@ #include "logic/BaseVersionList.h" #include "logic/tasks/Task.h" #include "logic/net/NetJob.h" +#include <logic/minecraft/RawLibrary.h> class LLListLoadTask; class QNetworkReply; @@ -55,7 +56,7 @@ public: int timestamp; bool isLatest; QString tweakClass; - QStringList libraries; + QList<RawLibraryPtr> libraries; // meta QString defaultUrl; |