aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Mansfield <jmansfield@cadixdev.org>2021-11-16 18:25:16 +0000
committerJamie Mansfield <jmansfield@cadixdev.org>2021-11-16 18:25:16 +0000
commit014e65220e2294d13ef579f449da9491a969bd30 (patch)
tree4eff03f6e0295236697e8d1a1250fa463d5fd049
parent6c82883206181eb7bb1504508bb13a205e0ea65e (diff)
downloadPrismLauncher-014e65220e2294d13ef579f449da9491a969bd30.tar.gz
PrismLauncher-014e65220e2294d13ef579f449da9491a969bd30.tar.bz2
PrismLauncher-014e65220e2294d13ef579f449da9491a969bd30.zip
NOISSUE Error on launch when launching 1.18 with < Java 17
-rw-r--r--launcher/minecraft/VersionFilterData.cpp1
-rw-r--r--launcher/minecraft/VersionFilterData.h2
-rw-r--r--launcher/minecraft/launch/VerifyJavaInstall.cpp11
3 files changed, 13 insertions, 1 deletions
diff --git a/launcher/minecraft/VersionFilterData.cpp b/launcher/minecraft/VersionFilterData.cpp
index 38e7b60c..c286d266 100644
--- a/launcher/minecraft/VersionFilterData.cpp
+++ b/launcher/minecraft/VersionFilterData.cpp
@@ -68,4 +68,5 @@ VersionFilterData::VersionFilterData()
java8BeginsDate = timeFromS3Time("2017-03-30T09:32:19+00:00");
java16BeginsDate = timeFromS3Time("2021-05-12T11:19:15+00:00");
+ java17BeginsDate = timeFromS3Time("2021-11-16T17:04:48+00:00");
}
diff --git a/launcher/minecraft/VersionFilterData.h b/launcher/minecraft/VersionFilterData.h
index 79756c3f..13445a51 100644
--- a/launcher/minecraft/VersionFilterData.h
+++ b/launcher/minecraft/VersionFilterData.h
@@ -25,5 +25,7 @@ struct VersionFilterData
QDateTime java8BeginsDate;
// release data of first version to require Java 16 (21w19a)
QDateTime java16BeginsDate;
+ // release data of first version to require Java 17 (1.18 Pre Release 2)
+ QDateTime java17BeginsDate;
};
extern VersionFilterData g_VersionFilterData;
diff --git a/launcher/minecraft/launch/VerifyJavaInstall.cpp b/launcher/minecraft/launch/VerifyJavaInstall.cpp
index 657669af..d9f7ecdc 100644
--- a/launcher/minecraft/launch/VerifyJavaInstall.cpp
+++ b/launcher/minecraft/launch/VerifyJavaInstall.cpp
@@ -11,8 +11,17 @@ void VerifyJavaInstall::executeTask() {
auto javaVersion = m_inst->getJavaVersion();
auto minecraftComponent = m_inst->getPackProfile()->getComponent("net.minecraft");
+ // Java 17 requirement
+ if (minecraftComponent->getReleaseDateTime() >= g_VersionFilterData.java17BeginsDate) {
+ if (javaVersion.major() < 17) {
+ emit logLine("Minecraft 1.18 Pre Release 2 and above require the use of Java 17",
+ MessageLevel::Fatal);
+ emitFailed(tr("Minecraft 1.18 Pre Release 2 and above require the use of Java 17"));
+ return;
+ }
+ }
// Java 16 requirement
- if (minecraftComponent->getReleaseDateTime() >= g_VersionFilterData.java16BeginsDate) {
+ else if (minecraftComponent->getReleaseDateTime() >= g_VersionFilterData.java16BeginsDate) {
if (javaVersion.major() < 16) {
emit logLine("Minecraft 21w19a and above require the use of Java 16",
MessageLevel::Fatal);