Add Quilt support for Technic modpacks

This commit is contained in:
Kenneth Chew 2022-05-30 14:01:38 -04:00
parent d7fad4bd04
commit 3585e4764b
No known key found for this signature in database
GPG Key ID: F17D3E14A07739DA

View File

@ -185,13 +185,22 @@ void Technic::TechnicPackProcessor::run(SettingsObjectPtr globalSettings, const
components->setComponentVersion("net.minecraftforge", libraryName.section('-', 1, 1)); components->setComponentVersion("net.minecraftforge", libraryName.section('-', 1, 1));
} }
} }
else if (libraryName.startsWith("net.minecraftforge:minecraftforge:")) else
{ {
components->setComponentVersion("net.minecraftforge", libraryName.section(':', 2)); static QSet<QString> possibleLoaders{
"net.minecraftforge:minecraftforge:",
"net.fabricmc:fabric-loader:",
"org.quiltmc:quilt-loader:"
};
for (const auto& loader : possibleLoaders)
{
if (libraryName.startsWith(loader))
{
auto loaderComponent = loader.chopped(1).replace(":", ".");
components->setComponentVersion(loaderComponent, libraryName.section(':', 2));
break;
}
} }
else if (libraryName.startsWith("net.fabricmc:fabric-loader:"))
{
components->setComponentVersion("net.fabricmc.fabric-loader", libraryName.section(':', 2));
} }
} }
} }