From 4ee6a6711d462d4f85c84afe6bc0e0e6640b1244 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 25 Sep 2023 23:04:21 +0300 Subject: [PATCH 1/4] Added version check for neoforge filter Signed-off-by: Trial97 --- launcher/minecraft/PackProfile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/minecraft/PackProfile.cpp b/launcher/minecraft/PackProfile.cpp index 9e42c5dd6..31974cd00 100644 --- a/launcher/minecraft/PackProfile.cpp +++ b/launcher/minecraft/PackProfile.cpp @@ -1018,8 +1018,8 @@ std::optional 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) + Version instance_ver{ getComponentVersion("net.minecraft") }; + if (instance_ver <= Version("1.20.1") && loaders & ModPlatform::NeoForge) loaders |= ModPlatform::Forge; return loaders; } From c78d4e7bb624cd79fcd330708040d92b9e607c88 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 4 Oct 2023 19:16:21 +0300 Subject: [PATCH 2/4] added version test for snapshot Signed-off-by: Trial97 --- tests/Version_test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Version_test.cpp b/tests/Version_test.cpp index d25bf7bb5..4c67cc544 100644 --- a/tests/Version_test.cpp +++ b/tests/Version_test.cpp @@ -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: From e913f61305de434cda5755f1db6bd3bb2ce4ea5e Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 4 Oct 2023 19:29:37 +0300 Subject: [PATCH 3/4] added a more strict condition for neoforge forge support Signed-off-by: Trial97 --- launcher/minecraft/PackProfile.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/launcher/minecraft/PackProfile.cpp b/launcher/minecraft/PackProfile.cpp index 31974cd00..aea78b552 100644 --- a/launcher/minecraft/PackProfile.cpp +++ b/launcher/minecraft/PackProfile.cpp @@ -1018,8 +1018,7 @@ std::optional PackProfile::getSupportedModLoaders() // TODO: remove this or add version condition once Quilt drops official Fabric support if (loaders & ModPlatform::Quilt) loaders |= ModPlatform::Fabric; - Version instance_ver{ getComponentVersion("net.minecraft") }; - if (instance_ver <= Version("1.20.1") && loaders & ModPlatform::NeoForge) + if (getComponentVersion("net.minecraft") == "1.20.1" && loaders & ModPlatform::NeoForge) loaders |= ModPlatform::Forge; return loaders; } From bca5e8f3952d44a1ff517123ff51ab439b295f84 Mon Sep 17 00:00:00 2001 From: Alexandru Ionut Tripon Date: Fri, 6 Oct 2023 16:16:03 +0300 Subject: [PATCH 4/4] Update launcher/minecraft/PackProfile.cpp Co-authored-by: TheKodeToad Signed-off-by: Alexandru Ionut Tripon --- launcher/minecraft/PackProfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/minecraft/PackProfile.cpp b/launcher/minecraft/PackProfile.cpp index aea78b552..9e706ae0a 100644 --- a/launcher/minecraft/PackProfile.cpp +++ b/launcher/minecraft/PackProfile.cpp @@ -1018,7 +1018,7 @@ std::optional PackProfile::getSupportedModLoaders() // TODO: remove this or add version condition once Quilt drops official Fabric support if (loaders & ModPlatform::Quilt) loaders |= ModPlatform::Fabric; - if (getComponentVersion("net.minecraft") == "1.20.1" && loaders & ModPlatform::NeoForge) + if (getComponentVersion("net.minecraft") == "1.20.1" && (loaders & ModPlatform::NeoForge)) loaders |= ModPlatform::Forge; return loaders; }