diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-07-19 23:16:02 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-07-19 23:16:02 +0200 |
commit | c767707c951bff6ff525a507be0393119e050b40 (patch) | |
tree | df40eca462f302f34b92db689ac1ce564375207b /logic/forge | |
parent | 8a56ab6780f525472dce4dccdd53fec41390d586 (diff) | |
download | MultiMC-c767707c951bff6ff525a507be0393119e050b40.tar MultiMC-c767707c951bff6ff525a507be0393119e050b40.tar.gz MultiMC-c767707c951bff6ff525a507be0393119e050b40.tar.lz MultiMC-c767707c951bff6ff525a507be0393119e050b40.tar.xz MultiMC-c767707c951bff6ff525a507be0393119e050b40.zip |
Make forge work.
Using classifiers FTW.
Diffstat (limited to 'logic/forge')
-rw-r--r-- | logic/forge/ForgeInstaller.cpp | 35 | ||||
-rw-r--r-- | logic/forge/ForgeVersion.h | 7 | ||||
-rw-r--r-- | logic/forge/ForgeVersionList.cpp | 6 |
3 files changed, 42 insertions, 6 deletions
diff --git a/logic/forge/ForgeInstaller.cpp b/logic/forge/ForgeInstaller.cpp index 7ab0a09b..74db2bfc 100644 --- a/logic/forge/ForgeInstaller.cpp +++ b/logic/forge/ForgeInstaller.cpp @@ -133,8 +133,8 @@ bool ForgeInstaller::add(OneSixInstance *to) int sliding_insert_window = 0; { QJsonArray librariesPlus; - // A blacklist - we ignore these entirely - QSet<QString> blacklist{"lwjgl", "lwjgl_util", "lwjgl-platform"}; + // A blacklist + QSet<QString> blacklist{"authlib", "realms"}; // QList<QString> xzlist{"org.scala-lang", "com.typesafe"}; // for each library in the version we are adding (except for the blacklisted) @@ -143,15 +143,38 @@ bool ForgeInstaller::add(OneSixInstance *to) QString libName = lib->name(); QString rawName = lib->rawName(); - // ignore blacklisted stuff + // ignore lwjgl libraries. + if (g_VersionFilterData.lwjglWhitelist.contains(lib->fullname())) + continue; + // ignore other blacklisted (realms, authlib) if (blacklist.contains(libName)) continue; // WARNING: This could actually break. // if this is the actual forge lib, set an absolute url for the download - if (libName.contains("minecraftforge")) + if(m_forge_version->type == ForgeVersion::Gradle) + { + if (libName == "forge") + { + lib->m_name.setClassifier("universal"); + lib->finalize(); + } + else if (libName == "minecraftforge") + { + QString forgeCoord ("net.minecraftforge:forge:%1:universal"); + // 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(); + } + } + else { - lib->setAbsoluteUrl(m_universal_url); + if (libName.contains("minecraftforge")) + { + lib->setAbsoluteUrl(m_universal_url); + } } // WARNING: This could actually break. @@ -192,7 +215,7 @@ bool ForgeInstaller::add(OneSixInstance *to) { // add lib libObj.insert("insert", QString("prepend")); - if (lib->name() == "minecraftforge") + if (lib->name() == "minecraftforge" || lib->name() == "forge") { libObj.insert("MMC-depend", QString("hard")); } diff --git a/logic/forge/ForgeVersion.h b/logic/forge/ForgeVersion.h index 466f46bd..c7adc572 100644 --- a/logic/forge/ForgeVersion.h +++ b/logic/forge/ForgeVersion.h @@ -17,6 +17,13 @@ struct ForgeVersion : public BaseVersion QString filename(); QString url(); + enum + { + Invalid, + Legacy, + Gradle + } type = Invalid; + bool usesInstaller(); int m_buildnr = 0; diff --git a/logic/forge/ForgeVersionList.cpp b/logic/forge/ForgeVersionList.cpp index efb30ba6..ee7c63e3 100644 --- a/logic/forge/ForgeVersionList.cpp +++ b/logic/forge/ForgeVersionList.cpp @@ -286,6 +286,7 @@ bool ForgeListLoadTask::parseForgeList(QList<BaseVersionPtr> &out) fVersion->installer_filename = installer_filename; fVersion->universal_filename = universal_filename; fVersion->m_buildnr = build_nr; + fVersion->type = ForgeVersion::Legacy; out.append(fVersion); } } @@ -335,6 +336,10 @@ bool ForgeListLoadTask::parseForgeGradleList(QList<BaseVersionPtr> &out) QJsonObject number = it.value().toObject(); std::shared_ptr<ForgeVersion> fVersion(new ForgeVersion()); fVersion->m_buildnr = number.value("build").toDouble(); + if(fVersion->m_buildnr >= 953 && fVersion->m_buildnr <= 965) + { + QLOG_DEBUG() << fVersion->m_buildnr; + } fVersion->jobbuildver = number.value("version").toString(); fVersion->branch = number.value("branch").toString(""); fVersion->mcver = number.value("mcversion").toString(); @@ -395,6 +400,7 @@ bool ForgeListLoadTask::parseForgeGradleList(QList<BaseVersionPtr> &out) } fVersion->universal_filename = universal_filename; fVersion->installer_filename = installer_filename; + fVersion->type = ForgeVersion::Gradle; out.append(fVersion); } return true; |