diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-02-20 20:55:26 +0100 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2022-04-07 18:46:09 +0200 |
commit | 35cfb41a9c8cf1328f3d2d14022cf51cbfc67f1f (patch) | |
tree | b315174ed647f46ce438ab07862caaca429e3cb4 /launcher/minecraft | |
parent | 74cdf5350de1649955814d6bcd596d8abfe9c5e2 (diff) | |
download | PrismLauncher-35cfb41a9c8cf1328f3d2d14022cf51cbfc67f1f.tar.gz PrismLauncher-35cfb41a9c8cf1328f3d2d14022cf51cbfc67f1f.tar.bz2 PrismLauncher-35cfb41a9c8cf1328f3d2d14022cf51cbfc67f1f.zip |
fix: check for Quilt as Fabric-compatible loader
Diffstat (limited to 'launcher/minecraft')
-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 |
3 files changed, 21 insertions, 1 deletions
diff --git a/launcher/minecraft/PackProfile.cpp b/launcher/minecraft/PackProfile.cpp index d516e555..9889727e 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::Any; +} 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)) { |