diff --git a/launcher/minecraft/VersionFilterData.cpp b/launcher/minecraft/VersionFilterData.cpp
index 64ae488c4d..a3e1012fc6 100644
--- a/launcher/minecraft/VersionFilterData.cpp
+++ b/launcher/minecraft/VersionFilterData.cpp
@@ -70,4 +70,7 @@ VersionFilterData::VersionFilterData()
java16BeginsDate = timeFromS3Time("2021-05-12T11:19:15+00:00");
java17BeginsDate = timeFromS3Time("2021-11-16T17:04:48+00:00");
quickPlayBeginsDate = timeFromS3Time("2023-04-05T12:05:17+00:00");
+ liteLoaderEndsDate = timeFromS3Time("2017-09-18T08:39:46+00:00");
+ fabricBeginsDate = timeFromS3Time("2019-04-23T14:52:44+00:00");
+ neoForgeBeginsDate = timeFromS3Time("2023-06-12T13:25:51+00:00");
}
diff --git a/launcher/minecraft/VersionFilterData.h b/launcher/minecraft/VersionFilterData.h
index 8ff0a00cfa..fbd45a5cde 100644
--- a/launcher/minecraft/VersionFilterData.h
+++ b/launcher/minecraft/VersionFilterData.h
@@ -29,5 +29,11 @@ struct VersionFilterData
QDateTime java17BeginsDate;
// release date of first version to use --quickPlayMultiplayer instead of --server/--port for directly joining servers
QDateTime quickPlayBeginsDate;
+ // release date of last version to support LiteLoader (1.12.2)
+ QDateTime liteLoaderEndsDate;
+ // release date of first version supported by Fabric/Quilt (1.14)
+ QDateTime fabricBeginsDate;
+ // release date of first version supported by NeoForge (1.20.1)
+ QDateTime neoForgeBeginsDate;
};
extern VersionFilterData g_VersionFilterData;
diff --git a/launcher/ui/pages/instance/VersionPage.cpp b/launcher/ui/pages/instance/VersionPage.cpp
index 4491729206..53d47a486e 100644
--- a/launcher/ui/pages/instance/VersionPage.cpp
+++ b/launcher/ui/pages/instance/VersionPage.cpp
@@ -39,6 +39,7 @@
#include "minecraft/PackProfile.h"
#include "minecraft/auth/AccountList.h"
#include "minecraft/mod/Mod.h"
+#include "minecraft/VersionFilterData.h"
#include "icons/IconList.h"
#include "Exception.h"
#include "Version.h"
@@ -209,16 +210,19 @@ void VersionPage::updateRunningStatus(bool running)
void VersionPage::updateVersionControls()
{
- // FIXME: this is a dirty hack
- auto minecraftVersion = Version(m_profile->getComponentVersion("net.minecraft"));
+ // FIXME: This is better than the broken stuff we had before, but it would probably be better to handle this in meta somehow
+ auto minecraftReleaseDate = m_profile->getComponent("net.minecraft")->getReleaseDateTime();
- bool supportsFabric = minecraftVersion >= Version("1.14");
+ bool supportsFabric = minecraftReleaseDate >= g_VersionFilterData.fabricBeginsDate;
ui->actionInstall_Fabric->setEnabled(controlsEnabled && supportsFabric);
ui->actionInstall_Quilt->setEnabled((controlsEnabled) && supportsFabric);
- bool supportsLiteLoader = minecraftVersion <= Version("1.12.2");
+ bool supportsLiteLoader = minecraftReleaseDate <= g_VersionFilterData.liteLoaderEndsDate;
ui->actionInstall_LiteLoader->setEnabled(controlsEnabled && supportsLiteLoader);
+ bool supportsNeoForge = minecraftReleaseDate >= g_VersionFilterData.neoForgeBeginsDate;
+ ui->actionInstall_NeoForge->setEnabled(controlsEnabled && supportsNeoForge);
+
updateButtons();
}
@@ -444,6 +448,35 @@ void VersionPage::on_actionInstall_Forge_triggered()
}
}
+void VersionPage::on_actionInstall_NeoForge_triggered()
+{
+ auto vlist = APPLICATION->metadataIndex()->get("net.neoforged");
+ if(!vlist)
+ {
+ return;
+ }
+ VersionSelectDialog vselect(vlist.get(), tr("Select NeoForge version"), this);
+ vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_profile->getComponentVersion("net.minecraft"));
+ vselect.setEmptyString(tr("No NeoForge versions are currently available for Minecraft ") + m_profile->getComponentVersion("net.minecraft"));
+ vselect.setEmptyErrorString(tr("Couldn't load or download the NeoForge version lists!"));
+
+ auto currentVersion = m_profile->getComponentVersion("net.neoforged");
+ if(!currentVersion.isEmpty())
+ {
+ vselect.setCurrentVersion(currentVersion);
+ }
+
+ if (vselect.exec() && vselect.selectedVersion())
+ {
+ auto vsn = vselect.selectedVersion();
+ m_profile->setComponentVersion("net.neoforged", vsn->descriptor());
+ m_profile->resolve(Net::Mode::Online);
+ // m_profile->installVersion();
+ preselect(m_profile->rowCount(QModelIndex())-1);
+ m_container->refreshContainer();
+ }
+}
+
void VersionPage::on_actionInstall_Fabric_triggered()
{
auto vlist = APPLICATION->metadataIndex()->get("net.fabricmc.fabric-loader");
diff --git a/launcher/ui/pages/instance/VersionPage.h b/launcher/ui/pages/instance/VersionPage.h
index 9045d4ad18..2f89bea109 100644
--- a/launcher/ui/pages/instance/VersionPage.h
+++ b/launcher/ui/pages/instance/VersionPage.h
@@ -51,6 +51,7 @@ class VersionPage : public QMainWindow, public BasePage
private slots:
void on_actionChange_version_triggered();
void on_actionInstall_Forge_triggered();
+ void on_actionInstall_NeoForge_triggered();
void on_actionInstall_Fabric_triggered();
void on_actionInstall_Quilt_triggered();
void on_actionAdd_Empty_triggered();
diff --git a/launcher/ui/pages/instance/VersionPage.ui b/launcher/ui/pages/instance/VersionPage.ui
index 489f721888..92f163608b 100644
--- a/launcher/ui/pages/instance/VersionPage.ui
+++ b/launcher/ui/pages/instance/VersionPage.ui
@@ -106,6 +106,7 @@
+
@@ -270,6 +271,14 @@
Open the instance's local libraries folder.
+
+
+ Install NeoForge
+
+
+ Install the NeoForge package.
+
+