Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Commit

Permalink
require java 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Titaniumtown committed Apr 23, 2021
1 parent 342e74b commit 2cf68d8
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 3 deletions.
2 changes: 2 additions & 0 deletions PATCHES.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ This is an overview over all patches that are currently used.
| server | Zombie horse naturally spawn | William Blake Galbreath | |
| server | add config for logging login location | Simon Gardling | |
| server | dont load chunks for physics | Aikar | |
| server | java 11 | Simon Gardling | |
| api | java 11 | Simon Gardling | |
| server | lithium DataTrackerMixin | JellySquid | tr7zw |
| server | lithium HashedList | JellySquid | |
| server | lithium MixinBox | JellySquid | |
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ subprojects {
}

java {
if(JavaVersion.VERSION_1_8 > JavaVersion.current()){
error("This build must be run with Java 8 or better")
if(JavaVersion.VERSION_11 > JavaVersion.current()){
error("This build must be run with Java 11 or later")
}
sourceCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.current()
withSourcesJar()
}
Expand Down
21 changes: 21 additions & 0 deletions patches/api/0009-java-11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Simon Gardling <titaniumtown@gmail.com>
Date: Fri, 23 Apr 2021 11:11:13 -0400
Subject: [PATCH] java 11


diff --git a/pom.xml b/pom.xml
index 4689aa0788afb7fe5b7c8d1a906373bef2744e91..da706aedb9926a95db6d4e72047b24efbda57447 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,8 +19,8 @@

<properties>
<!-- <skipTests>true</skipTests> Paper - This [was] not going to end well -->
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
+ <maven.compiler.source>11</maven.compiler.source>
+ <maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

59 changes: 59 additions & 0 deletions patches/server/0076-java-11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Simon Gardling <titaniumtown@gmail.com>
Date: Fri, 23 Apr 2021 11:11:20 -0400
Subject: [PATCH] java 11


diff --git a/pom.xml b/pom.xml
index f0a73238612327d71cf78801df816823d80893a0..57a87372c039fb410c97eaa00227b429b90da2b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,8 +14,8 @@
<bt.name>git</bt.name>
<minecraft.version>1.16.5</minecraft.version>
<minecraft_version>1_16_R3</minecraft_version>
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
+ <maven.compiler.source>11</maven.compiler.source>
+ <maven.compiler.target>11</maven.compiler.target>
</properties>

<parent>
diff --git a/src/main/java/io/papermc/paper/util/PaperJvmChecker.java b/src/main/java/io/papermc/paper/util/PaperJvmChecker.java
index c6ea429819c07e7f4bc257cad73463a030767825..b64ffe8240409e038c80a0384c5938e5141bc838 100644
--- a/src/main/java/io/papermc/paper/util/PaperJvmChecker.java
+++ b/src/main/java/io/papermc/paper/util/PaperJvmChecker.java
@@ -28,21 +28,18 @@ public class PaperJvmChecker {
public static void checkJvm() {
if (getJvmVersion() < 11) {
final Logger logger = LogManager.getLogger();
- logger.warn("************************************************************");
- logger.warn("* WARNING - YOU ARE RUNNING AN OUTDATED VERSION OF JAVA.");
- logger.warn("* PAPER WILL STOP BEING COMPATIBLE WITH THIS VERSION OF");
- logger.warn("* JAVA WHEN MINECRAFT 1.17 IS RELEASED.");
- logger.warn("*");
- logger.warn("* Please update the version of Java you use to run Paper");
- logger.warn("* to at least Java 11. When Paper for Minecraft 1.17 is");
- logger.warn("* released support for versions of Java before 11 will");
- logger.warn("* be dropped.");
- logger.warn("*");
- logger.warn("* Current Java version: {}", System.getProperty("java.version"));
- logger.warn("*");
- logger.warn("* Check this forum post for more information: ");
- logger.warn("* https://papermc.io/java11");
- logger.warn("************************************************************");
+ // Yatopia start - require java 11+
+ // Note - no clue how someone would run a jar built for java 11 on a java version lower than 11, but doesn't hurt to update this warning I guess.
+ logger.fatal("************************************************************");
+ logger.fatal("* ERROR - YOU ARE RUNNING AN OUTDATED VERSION OF JAVA.");
+ logger.fatal("* YOU NEED TO BE RUNNING JAVA 11 OR HIGHER");
+ logger.fatal("* In order to achieve Yatopia's high performance,");
+ logger.fatal("* Yatopia uses features only found in Java 11 or higher.");
+ logger.fatal("* If you do not know how to install Java 11 or have any other questions,");
+ logger.fatal("* Join our discord server (https://discord.io/YatopiaMC) and ask for support in #yatopia-help");
+ logger.fatal("************************************************************");
+ System.exit()
+ // Yatopia end
}
}
}

0 comments on commit 2cf68d8

Please sign in to comment.