Merge pull request #1658 from Trial97/neoforge_version

Added version check for neoforge filter
This commit is contained in:
Alexandru Ionut Tripon 2023-10-10 16:16:21 +01:00 committed by GitHub
commit 6150908025
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -1018,8 +1018,7 @@ std::optional<ModPlatform::ModLoaderTypes> PackProfile::getSupportedModLoaders()
// TODO: remove this or add version condition once Quilt drops official Fabric support
if (loaders & ModPlatform::Quilt)
loaders |= ModPlatform::Fabric;
// TODO: remove this or add version condition once NeoForge drops official Forge support
if (loaders & ModPlatform::NeoForge)
if (getComponentVersion("net.minecraft") == "1.20.1" && (loaders & ModPlatform::NeoForge))
loaders |= ModPlatform::Forge;
return loaders;
}

View File

@ -55,6 +55,8 @@ class VersionTest : public QObject {
<< "2.2.0" << true << false;
QTest::newRow("lessThan, two-digit") << "1.41"
<< "1.42" << true << false;
QTest::newRow("lessThan, snapshot") << "1.20.0-rc2"
<< "1.20.1" << true << false;
QTest::newRow("greaterThan, explicit 1") << "1.2.1"
<< "1.2.0" << false << false;
@ -72,6 +74,8 @@ class VersionTest : public QObject {
<< "1.2" << false << false;
QTest::newRow("greaterThan, two-digit") << "1.42"
<< "1.41" << false << false;
QTest::newRow("greaterThan, snapshot") << "1.20.2-rc2"
<< "1.20.1" << false << false;
}
private slots: