Fix up 1.7.10 forge versions for Technic platform import by removing -1.7.10 suffix

This commit is contained in:
kb1000 2021-01-29 10:18:33 +01:00
parent 02887536f7
commit df2b9adc1e
No known key found for this signature in database
GPG Key ID: C174DD765CC3E131

View File

@ -176,7 +176,16 @@ void Technic::TechnicPackProcessor::run(SettingsObjectPtr globalSettings, const
if (libraryName.startsWith("net.minecraftforge:forge:") && libraryName.contains('-')) if (libraryName.startsWith("net.minecraftforge:forge:") && libraryName.contains('-'))
{ {
components->setComponentVersion("net.minecraftforge", libraryName.section('-', 1)); QString libraryVersion = libraryName.section(':', 2);
if (!libraryVersion.startsWith("1.7.10-"))
{
components->setComponentVersion("net.minecraftforge", libraryName.section('-', 1));
}
else
{
// 1.7.10 versions sometimes look like 1.7.10-10.13.4.1614-1.7.10, this filters out the 10.13.4.1614 part
components->setComponentVersion("net.minecraftforge", libraryName.section('-', 1, 1));
}
} }
else if (libraryName.startsWith("net.minecraftforge:minecraftforge:")) else if (libraryName.startsWith("net.minecraftforge:minecraftforge:"))
{ {