From 438ddfb88dc4fede0c197107a1464990d7ec5a8d Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Wed, 14 Apr 2021 18:20:50 +0100 Subject: [PATCH] NOISSUE Support Fabric modpacks on ATLauncher Annoyingly the metadata structure is loader dependent :( --- .../modplatform/atlauncher/ATLPackManifest.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/api/logic/modplatform/atlauncher/ATLPackManifest.cpp b/api/logic/modplatform/atlauncher/ATLPackManifest.cpp index 50682391..df42c5bb 100644 --- a/api/logic/modplatform/atlauncher/ATLPackManifest.cpp +++ b/api/logic/modplatform/atlauncher/ATLPackManifest.cpp @@ -84,12 +84,18 @@ static void loadVersionLoader(ATLauncher::VersionLoader & p, QJsonObject & obj) p.choose = Json::ensureBoolean(obj, QString("choose"), false); auto metadata = Json::requireObject(obj, "metadata"); - - if (metadata.contains("version")) { - p.version = Json::requireString(metadata, "version"); - } p.latest = Json::ensureBoolean(metadata, QString("latest"), false); p.recommended = Json::ensureBoolean(metadata, QString("recommended"), false); + + // Minecraft Forge + if (p.type == "forge") { + p.version = Json::ensureString(metadata, "version", ""); + } + + // Fabric Loader + if (p.type == "fabric") { + p.version = Json::ensureString(metadata, "loader", ""); + } } static void loadVersionLibrary(ATLauncher::VersionLibrary & p, QJsonObject & obj) {