diff options
author | Irgendwer01 <67506320+Irgendwer01@users.noreply.github.com> | 2022-04-15 13:04:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-15 13:04:25 +0200 |
commit | ecad388846060f486bc1ae665ffa854d3b867ee1 (patch) | |
tree | a946ef393142bf9f4cf6f32842faf44bc0d5c19a /launcher/minecraft | |
parent | 9a120f43c8df3062e34c32b28f3060b95e61249a (diff) | |
parent | 4ff1306e0c6c4c1a8c9b3c2ee72f8e7f0aa590dc (diff) | |
download | PrismLauncher-ecad388846060f486bc1ae665ffa854d3b867ee1.tar.gz PrismLauncher-ecad388846060f486bc1ae665ffa854d3b867ee1.tar.bz2 PrismLauncher-ecad388846060f486bc1ae665ffa854d3b867ee1.zip |
Merge branch 'PolyMC:develop' into develop
Diffstat (limited to 'launcher/minecraft')
-rw-r--r-- | launcher/minecraft/ComponentUpdateTask.cpp | 2 | ||||
-rw-r--r-- | launcher/minecraft/PackProfile.cpp | 17 | ||||
-rw-r--r-- | launcher/minecraft/PackProfile.h | 3 | ||||
-rw-r--r-- | launcher/minecraft/mod/LocalModParseTask.cpp | 2 |
4 files changed, 22 insertions, 2 deletions
diff --git a/launcher/minecraft/ComponentUpdateTask.cpp b/launcher/minecraft/ComponentUpdateTask.cpp index 8bc05a1b..ff7ed0af 100644 --- a/launcher/minecraft/ComponentUpdateTask.cpp +++ b/launcher/minecraft/ComponentUpdateTask.cpp @@ -591,7 +591,7 @@ void ComponentUpdateTask::resolveDependencies(bool checkOnly) { component->m_version = "3.1.2"; } - else if (add.uid == "net.fabricmc.intermediary") + else if (add.uid == "net.fabricmc.intermediary" || add.uid == "org.quiltmc.hashed") { auto minecraft = std::find_if(components.begin(), components.end(), [](ComponentPtr & cmp){ return cmp->getID() == "net.minecraft"; diff --git a/launcher/minecraft/PackProfile.cpp b/launcher/minecraft/PackProfile.cpp index d516e555..d53f41e1 100644 --- a/launcher/minecraft/PackProfile.cpp +++ b/launcher/minecraft/PackProfile.cpp @@ -970,3 +970,20 @@ void PackProfile::disableInteraction(bool disable) } } } + +ModAPI::ModLoaderType PackProfile::getModLoader() +{ + if (!getComponentVersion("net.minecraftforge").isEmpty()) + { + return ModAPI::Forge; + } + else if (!getComponentVersion("net.fabricmc.fabric-loader").isEmpty()) + { + return ModAPI::Fabric; + } + else if (!getComponentVersion("org.quiltmc.quilt-loader").isEmpty()) + { + return ModAPI::Quilt; + } + return ModAPI::Unspecified; +} diff --git a/launcher/minecraft/PackProfile.h b/launcher/minecraft/PackProfile.h index 989d1c6a..ab4cd5c8 100644 --- a/launcher/minecraft/PackProfile.h +++ b/launcher/minecraft/PackProfile.h @@ -28,6 +28,7 @@ #include "BaseVersion.h" #include "MojangDownloadInfo.h" #include "net/Mode.h" +#include "modplatform/ModAPI.h" class MinecraftInstance; struct PackProfileData; @@ -117,6 +118,8 @@ public: // todo(merged): is this the best approach void appendComponent(ComponentPtr component); + ModAPI::ModLoaderType getModLoader(); + private: void scheduleSave(); bool saveIsScheduled() const; diff --git a/launcher/minecraft/mod/LocalModParseTask.cpp b/launcher/minecraft/mod/LocalModParseTask.cpp index 757a2187..f01da8ae 100644 --- a/launcher/minecraft/mod/LocalModParseTask.cpp +++ b/launcher/minecraft/mod/LocalModParseTask.cpp @@ -391,7 +391,7 @@ void LocalModParseTask::processAsZip() zip.close(); return; } - else if (zip.setCurrentFile("fabric.mod.json")) + else if (zip.setCurrentFile("fabric.mod.json")) // TODO: Support quilt.mod.json { if (!file.open(QIODevice::ReadOnly)) { |