From 03b13b0b3f43e830ca924338b38e1947cd0cc739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 26 Jul 2014 23:00:35 +0200 Subject: Rearrange RawLibrary and OneSixLibrary heavily. Fix #396 --- logic/forge/ForgeInstaller.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'logic/forge') diff --git a/logic/forge/ForgeInstaller.cpp b/logic/forge/ForgeInstaller.cpp index 74db2bfc..a230b038 100644 --- a/logic/forge/ForgeInstaller.cpp +++ b/logic/forge/ForgeInstaller.cpp @@ -85,7 +85,6 @@ void ForgeInstaller::prepare(const QString &filename, const QString &universalUr // where do we put the library? decode the mojang path OneSixLibrary lib(libraryName); - lib.finalize(); auto cacheentry = MMC->metacache()->resolveEntry("libraries", lib.storagePath()); finalPath = "libraries/" + lib.storagePath(); @@ -140,11 +139,11 @@ bool ForgeInstaller::add(OneSixInstance *to) // for each library in the version we are adding (except for the blacklisted) for (auto lib : m_forge_json->libraries) { - QString libName = lib->name(); + QString libName = lib->artifactId(); QString rawName = lib->rawName(); // ignore lwjgl libraries. - if (g_VersionFilterData.lwjglWhitelist.contains(lib->fullname())) + if (g_VersionFilterData.lwjglWhitelist.contains(lib->artifactPrefix())) continue; // ignore other blacklisted (realms, authlib) if (blacklist.contains(libName)) @@ -156,8 +155,7 @@ bool ForgeInstaller::add(OneSixInstance *to) { if (libName == "forge") { - lib->m_name.setClassifier("universal"); - lib->finalize(); + lib->setClassifier("universal"); } else if (libName == "minecraftforge") { @@ -165,8 +163,7 @@ bool ForgeInstaller::add(OneSixInstance *to) // using insane form of the MC version... QString longVersion = m_forge_version->mcver + "-" + m_forge_version->jobbuildver; GradleSpecifier spec(forgeCoord.arg(longVersion)); - lib->m_name = spec; - lib->finalize(); + lib->setRawName(spec); } } else @@ -196,7 +193,7 @@ bool ForgeInstaller::add(OneSixInstance *to) // find an entry that matches this one for (auto tolib : to->getFullVersion()->vanillaLibraries) { - if (tolib->name() != libName) + if (tolib->artifactId() != libName) continue; found = true; if (tolib->toJson() == libObj) @@ -215,7 +212,7 @@ bool ForgeInstaller::add(OneSixInstance *to) { // add lib libObj.insert("insert", QString("prepend")); - if (lib->name() == "minecraftforge" || lib->name() == "forge") + if (lib->artifactId() == "minecraftforge" || lib->artifactId() == "forge") { libObj.insert("MMC-depend", QString("hard")); } -- cgit v1.2.3