diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-05-05 00:10:59 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-06-09 01:38:29 +0200 |
commit | 4c3bd416c65ec887209fa06b0a5634099b77f322 (patch) | |
tree | f656031d147aba8f8dd621de2bd452ea1bfd86b4 /logic/forge | |
parent | aade36860c373268857ca821c14a13f38c880b1a (diff) | |
download | MultiMC-4c3bd416c65ec887209fa06b0a5634099b77f322.tar MultiMC-4c3bd416c65ec887209fa06b0a5634099b77f322.tar.gz MultiMC-4c3bd416c65ec887209fa06b0a5634099b77f322.tar.lz MultiMC-4c3bd416c65ec887209fa06b0a5634099b77f322.tar.xz MultiMC-4c3bd416c65ec887209fa06b0a5634099b77f322.zip |
Much change, very jarmod.
Diffstat (limited to 'logic/forge')
-rw-r--r-- | logic/forge/ForgeData.cpp | 62 | ||||
-rw-r--r-- | logic/forge/ForgeData.h | 21 | ||||
-rw-r--r-- | logic/forge/ForgeInstaller.cpp | 24 | ||||
-rw-r--r-- | logic/forge/ForgeVersion.cpp | 4 | ||||
-rw-r--r-- | logic/forge/ForgeVersionList.cpp | 1 | ||||
-rw-r--r-- | logic/forge/ForgeVersionList.h | 2 |
6 files changed, 22 insertions, 92 deletions
diff --git a/logic/forge/ForgeData.cpp b/logic/forge/ForgeData.cpp deleted file mode 100644 index 700b847b..00000000 --- a/logic/forge/ForgeData.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "ForgeData.h" - -extern ForgeData g_forgeData = ForgeData(); - -ForgeData::ForgeData() -{ - // 1.3.* - auto libs13 = - QList<FMLlib>{{"argo-2.25.jar", "bb672829fde76cb163004752b86b0484bd0a7f4b", false}, - {"guava-12.0.1.jar", "b8e78b9af7bf45900e14c6f958486b6ca682195f", false}, - {"asm-all-4.0.jar", "98308890597acb64047f7e896638e0d98753ae82", false}}; - - fmlLibsMapping["1.3.2"] = libs13; - - // 1.4.* - auto libs14 = QList<FMLlib>{ - {"argo-2.25.jar", "bb672829fde76cb163004752b86b0484bd0a7f4b", false}, - {"guava-12.0.1.jar", "b8e78b9af7bf45900e14c6f958486b6ca682195f", false}, - {"asm-all-4.0.jar", "98308890597acb64047f7e896638e0d98753ae82", false}, - {"bcprov-jdk15on-147.jar", "b6f5d9926b0afbde9f4dbe3db88c5247be7794bb", false}}; - - fmlLibsMapping["1.4"] = libs14; - fmlLibsMapping["1.4.1"] = libs14; - fmlLibsMapping["1.4.2"] = libs14; - fmlLibsMapping["1.4.3"] = libs14; - fmlLibsMapping["1.4.4"] = libs14; - fmlLibsMapping["1.4.5"] = libs14; - fmlLibsMapping["1.4.6"] = libs14; - fmlLibsMapping["1.4.7"] = libs14; - - // 1.5 - fmlLibsMapping["1.5"] = QList<FMLlib>{ - {"argo-small-3.2.jar", "58912ea2858d168c50781f956fa5b59f0f7c6b51", false}, - {"guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", false}, - {"asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58", false}, - {"bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", true}, - {"deobfuscation_data_1.5.zip", "5f7c142d53776f16304c0bbe10542014abad6af8", false}, - {"scala-library.jar", "458d046151ad179c85429ed7420ffb1eaf6ddf85", true}}; - - // 1.5.1 - fmlLibsMapping["1.5.1"] = QList<FMLlib>{ - {"argo-small-3.2.jar", "58912ea2858d168c50781f956fa5b59f0f7c6b51", false}, - {"guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", false}, - {"asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58", false}, - {"bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", true}, - {"deobfuscation_data_1.5.1.zip", "22e221a0d89516c1f721d6cab056a7e37471d0a6", false}, - {"scala-library.jar", "458d046151ad179c85429ed7420ffb1eaf6ddf85", true}}; - - // 1.5.2 - fmlLibsMapping["1.5.2"] = QList<FMLlib>{ - {"argo-small-3.2.jar", "58912ea2858d168c50781f956fa5b59f0f7c6b51", false}, - {"guava-14.0-rc3.jar", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", false}, - {"asm-all-4.1.jar", "054986e962b88d8660ae4566475658469595ef58", false}, - {"bcprov-jdk15on-148.jar", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", true}, - {"deobfuscation_data_1.5.2.zip", "446e55cd986582c70fcf12cb27bc00114c5adfd9", false}, - {"scala-library.jar", "458d046151ad179c85429ed7420ffb1eaf6ddf85", true}}; - - // don't use installers for those. - forgeInstallerBlacklist = QSet<QString>({ - "1.5.2" - }); -} diff --git a/logic/forge/ForgeData.h b/logic/forge/ForgeData.h deleted file mode 100644 index 27749778..00000000 --- a/logic/forge/ForgeData.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include <QMap> -#include <QString> -#include <QSet> - -struct FMLlib -{ - QString filename; - QString checksum; - bool ours; -}; - -struct ForgeData -{ - ForgeData(); - // mapping between minecraft versions and FML libraries required - QMap<QString, QList<FMLlib>> fmlLibsMapping; - // set of minecraft versions for which using forge installers is blacklisted - QSet<QString> forgeInstallerBlacklist; -}; -extern ForgeData g_forgeData; diff --git a/logic/forge/ForgeInstaller.cpp b/logic/forge/ForgeInstaller.cpp index 1204b855..3b13a7cd 100644 --- a/logic/forge/ForgeInstaller.cpp +++ b/logic/forge/ForgeInstaller.cpp @@ -20,7 +20,7 @@ #include "logic/tasks/Task.h" #include "logic/OneSixInstance.h" #include "logic/forge/ForgeVersionList.h" -#include "ForgeData.h" +#include "logic/VersionFilterData.h" #include "gui/dialogs/ProgressDialog.h" #include <quazip.h> @@ -239,7 +239,16 @@ bool ForgeInstaller::addLegacy(OneSixInstance *to) { return false; } - + auto entry = MMC->metacache()->resolveEntry("minecraftforge", m_forge_version->filename()); + finalPath = PathCombine(to->jarModsDir(), m_forge_version->filename()); + if (!ensureFilePathExists(finalPath)) + { + return false; + } + if (!QFile::copy(entry->getFullPath(),finalPath)) + { + return false; + } QJsonObject obj; obj.insert("order", 5); { @@ -256,13 +265,15 @@ bool ForgeInstaller::addLegacy(OneSixInstance *to) obj.insert("fileId", id()); obj.insert("version", m_forge_version->jobbuildver); obj.insert("mcVersion", to->intendedVersionId()); - if (g_forgeData.fmlLibsMapping.contains(m_forge_version->mcver)) + if (g_VersionFilterData.fmlLibsMapping.contains(m_forge_version->mcver)) { QJsonArray traitsPlus; traitsPlus.append(QString("legacyFML")); obj.insert("+traits", traitsPlus); } - + auto fullversion = to->getFullVersion(); + fullversion->remove("net.minecraftforge"); + QFile file(filename(to->instanceRoot())); if (!file.open(QFile::WriteOnly)) { @@ -299,8 +310,7 @@ protected: } void prepare(ForgeVersionPtr forgeVersion) { - auto entry = - MMC->metacache()->resolveEntry("minecraftforge", forgeVersion->filename()); + auto entry = MMC->metacache()->resolveEntry("minecraftforge", forgeVersion->filename()); auto installFunction = [this, entry, forgeVersion]() { if (!install(entry, forgeVersion)) @@ -313,7 +323,7 @@ protected: reload(); } }; - + if (entry->stale) { NetJob *fjob = new NetJob("Forge download"); diff --git a/logic/forge/ForgeVersion.cpp b/logic/forge/ForgeVersion.cpp index fd4efc4b..3131ec39 100644 --- a/logic/forge/ForgeVersion.cpp +++ b/logic/forge/ForgeVersion.cpp @@ -1,5 +1,5 @@ #include "ForgeVersion.h" -#include "ForgeData.h" +#include "logic/VersionFilterData.h" #include <QObject> QString ForgeVersion::name() @@ -39,7 +39,7 @@ bool ForgeVersion::usesInstaller() { if(installer_url.isEmpty()) return false; - if(g_forgeData.forgeInstallerBlacklist.contains(mcver)) + if(g_VersionFilterData.forgeInstallerBlacklist.contains(mcver)) return false; return true; } diff --git a/logic/forge/ForgeVersionList.cpp b/logic/forge/ForgeVersionList.cpp index c873bab7..545fff42 100644 --- a/logic/forge/ForgeVersionList.cpp +++ b/logic/forge/ForgeVersionList.cpp @@ -421,6 +421,7 @@ void ForgeListLoadTask::listFailed() QLOG_ERROR() << "Getting forge version list failed for reasons unknown."; } } + void ForgeListLoadTask::gradleListFailed() { auto reply = gradleListDownload->m_reply; diff --git a/logic/forge/ForgeVersionList.h b/logic/forge/ForgeVersionList.h index c848e9b8..2c020b0f 100644 --- a/logic/forge/ForgeVersionList.h +++ b/logic/forge/ForgeVersionList.h @@ -41,6 +41,8 @@ public: virtual BaseVersionPtr getLatestStable() const; + ForgeVersionPtr findVersionByVersionNr(QString version); + virtual QVariant data(const QModelIndex &index, int role) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; virtual int columnCount(const QModelIndex &parent) const; |