aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/flame
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-08-19 00:38:40 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-08-19 00:38:40 +0300
commitab6301d5a1a2a77d12d73f4ff7088551d6b8aa2e (patch)
treeef416fc819e833a5319da76e9abf30110a0c932f /launcher/modplatform/flame
parentc5bac475e86ec1c4e0053bd330eabedcbca124f6 (diff)
parent3098aecf9760074a291bd8460ce749e556baad3a (diff)
downloadPrismLauncher-ab6301d5a1a2a77d12d73f4ff7088551d6b8aa2e.tar.gz
PrismLauncher-ab6301d5a1a2a77d12d73f4ff7088551d6b8aa2e.tar.bz2
PrismLauncher-ab6301d5a1a2a77d12d73f4ff7088551d6b8aa2e.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into develop
Diffstat (limited to 'launcher/modplatform/flame')
-rw-r--r--launcher/modplatform/flame/FlameAPI.h6
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.cpp8
-rw-r--r--launcher/modplatform/flame/FlamePackExportTask.cpp3
3 files changed, 13 insertions, 4 deletions
diff --git a/launcher/modplatform/flame/FlameAPI.h b/launcher/modplatform/flame/FlameAPI.h
index 281c0a09..a1256e17 100644
--- a/launcher/modplatform/flame/FlameAPI.h
+++ b/launcher/modplatform/flame/FlameAPI.h
@@ -24,7 +24,7 @@ class FlameAPI : public NetworkResourceAPI {
[[nodiscard]] auto getSortingMethods() const -> QList<ResourceAPI::SortingMethod> override;
- static inline auto validateModLoaders(ModLoaderTypes loaders) -> bool { return loaders & (Forge | Fabric | Quilt); }
+ static inline auto validateModLoaders(ModLoaderTypes loaders) -> bool { return loaders & (NeoForge | Forge | Fabric | Quilt); }
private:
static int getClassId(ModPlatform::ResourceType type)
@@ -47,7 +47,9 @@ class FlameAPI : public NetworkResourceAPI {
return 4;
// TODO: remove this once Quilt drops official Fabric support
if (loaders & Quilt) // NOTE: Most if not all Fabric mods should work *currently*
- return 4; // Quilt would probably be 5
+ return 4; // FIXME: implement multiple loaders filter
+ if (loaders & NeoForge)
+ return 6;
return 0;
}
diff --git a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
index 9fe8d486..45b4e212 100644
--- a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
+++ b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
@@ -284,7 +284,7 @@ QString FlameCreationTask::getVersionForLoader(QString uid, QString loaderType,
// filter by minecraft version, if the loader depends on a certain version.
// not all mod loaders depend on a given Minecraft version, so we won't do this
// filtering for those loaders.
- if (loaderType == "forge") {
+ if (loaderType == "forge" || loaderType == "neoforge") {
auto iter = std::find_if(reqs.begin(), reqs.end(), [mcVersion](const Meta::Require& req) {
return req.uid == "net.minecraft" && req.equalsVersion == mcVersion;
});
@@ -350,7 +350,11 @@ bool FlameCreationTask::createInstance()
for (auto& loader : m_pack.minecraft.modLoaders) {
auto id = loader.id;
- if (id.startsWith("forge-")) {
+ if (id.startsWith("neoforge-")) {
+ id.remove("neoforge-");
+ loaderType = "neoforge";
+ loaderUid = "net.neoforged";
+ } else if (id.startsWith("forge-")) {
id.remove("forge-");
loaderType = "forge";
loaderUid = "net.minecraftforge";
diff --git a/launcher/modplatform/flame/FlamePackExportTask.cpp b/launcher/modplatform/flame/FlamePackExportTask.cpp
index f5f3af37..0863f0b2 100644
--- a/launcher/modplatform/flame/FlamePackExportTask.cpp
+++ b/launcher/modplatform/flame/FlamePackExportTask.cpp
@@ -381,6 +381,7 @@ QByteArray FlamePackExportTask::generateIndex()
const ComponentPtr quilt = profile->getComponent("org.quiltmc.quilt-loader");
const ComponentPtr fabric = profile->getComponent("net.fabricmc.fabric-loader");
const ComponentPtr forge = profile->getComponent("net.minecraftforge");
+ const ComponentPtr neoforge = profile->getComponent("net.neoforged");
// convert all available components to mrpack dependencies
if (minecraft != nullptr)
@@ -392,6 +393,8 @@ QByteArray FlamePackExportTask::generateIndex()
id = "fabric-" + fabric->getVersion();
else if (forge != nullptr)
id = "forge-" + forge->getVersion();
+ else if (neoforge != nullptr)
+ id = "neoforge-" + neoforge->getVersion();
version["modLoaders"] = QJsonArray();
if (!id.isEmpty()) {
QJsonObject loader;