From 4ab0e70a9af2992f917b7900dbc99352b1134652 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 8 Jul 2022 17:27:15 +0200 Subject: [PATCH] fix(technic): map loader libraries to components properly Signed-off-by: Sefa Eyeoglu --- .../modplatform/technic/TechnicPackProcessor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/launcher/modplatform/technic/TechnicPackProcessor.cpp b/launcher/modplatform/technic/TechnicPackProcessor.cpp index 471b4a2f..95feb4b2 100644 --- a/launcher/modplatform/technic/TechnicPackProcessor.cpp +++ b/launcher/modplatform/technic/TechnicPackProcessor.cpp @@ -187,17 +187,17 @@ void Technic::TechnicPackProcessor::run(SettingsObjectPtr globalSettings, const } else { - static QStringList possibleLoaders{ - "net.minecraftforge:minecraftforge:", - "net.fabricmc:fabric-loader:", - "org.quiltmc:quilt-loader:" + // -> + static QMap loaderMap { + {"net.minecraftforge:minecraftforge:", "net.minecraftforge"}, + {"net.fabricmc:fabric-loader:", "net.fabricmc.fabric-loader"}, + {"org.quiltmc:quilt-loader:", "org.quiltmc.quilt-loader"} }; - for (const auto& loader : possibleLoaders) + for (const auto& loader : loaderMap.keys()) { if (libraryName.startsWith(loader)) { - auto loaderComponent = loader.chopped(1).replace(":", "."); - components->setComponentVersion(loaderComponent, libraryName.section(':', 2)); + components->setComponentVersion(loaderMap.value(loader), libraryName.section(':', 2)); break; } }