aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/flame
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-08-23 11:33:45 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-08-23 11:33:45 +0300
commitf8f9ffa1182c76cd22c2c181820bdd9516d7958f (patch)
tree3988a0c08ae8126ad8e662276645890e3b562964 /launcher/modplatform/flame
parent4704c522e002e0da2c9ce49f71456fce684ab3a1 (diff)
downloadPrismLauncher-f8f9ffa1182c76cd22c2c181820bdd9516d7958f.tar.gz
PrismLauncher-f8f9ffa1182c76cd22c2c181820bdd9516d7958f.tar.bz2
PrismLauncher-f8f9ffa1182c76cd22c2c181820bdd9516d7958f.zip
added loaders for flame version
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform/flame')
-rw-r--r--launcher/modplatform/flame/FileResolvingTask.cpp3
-rw-r--r--launcher/modplatform/flame/FlameModIndex.cpp13
2 files changed, 15 insertions, 1 deletions
diff --git a/launcher/modplatform/flame/FileResolvingTask.cpp b/launcher/modplatform/flame/FileResolvingTask.cpp
index 860d7340..07a3ae63 100644
--- a/launcher/modplatform/flame/FileResolvingTask.cpp
+++ b/launcher/modplatform/flame/FileResolvingTask.cpp
@@ -1,5 +1,6 @@
#include "FileResolvingTask.h"
+#include <bitset>
#include "Json.h"
#include "net/ApiDownload.h"
#include "net/ApiUpload.h"
@@ -153,7 +154,7 @@ void Flame::FileResolvingTask::modrinthCheckFinished()
// If there's more than one mod loader for this version, we can't know for sure
// which file is relative to each loader, so it's best to not use any one and
// let the user download it manually.
- if (file.loaders.size() <= 1) {
+ if (std::bitset<8>(file.loaders.toInt()).count() <= 1) {
out->url = file.downloadUrl;
qDebug() << "Found alternative on modrinth " << out->fileName;
} else {
diff --git a/launcher/modplatform/flame/FlameModIndex.cpp b/launcher/modplatform/flame/FlameModIndex.cpp
index 19803cf6..8924913b 100644
--- a/launcher/modplatform/flame/FlameModIndex.cpp
+++ b/launcher/modplatform/flame/FlameModIndex.cpp
@@ -115,6 +115,19 @@ auto FlameMod::loadIndexedPackVersion(QJsonObject& obj, bool load_changelog) ->
if (str.contains('.'))
file.mcVersion.append(str);
+ auto loader = str.toLower();
+ if (loader == "neoforge")
+ file.loaders |= ModPlatform::NeoForge;
+ if (loader == "forge")
+ file.loaders |= ModPlatform::Forge;
+ if (loader == "cauldron")
+ file.loaders |= ModPlatform::Cauldron;
+ if (loader == "liteloader")
+ file.loaders |= ModPlatform::LiteLoader;
+ if (loader == "fabric")
+ file.loaders |= ModPlatform::Fabric;
+ if (loader == "quilt")
+ file.loaders |= ModPlatform::Quilt;
}
file.addonId = Json::requireInteger(obj, "modId");