fix: move to jline-terminal-ffm on java 22+ and fall back to jni on 21, fixes #10405
ffm requires 1) native access allowed (the jdk cracks down on undocumented native access in 22) and 2) reverting the default console back to java.base, so the internal jline doesnt take over
This commit is contained in:
parent
4e01ede950
commit
d8b66dd93d
12 changed files with 37 additions and 35 deletions
|
@ -11,7 +11,7 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|||
Co-authored-by: masmc05 <masmc05@gmail.com>
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 47df5ac22b0fc97381364eb4d16e33768ff9794c..dfc9ca34656cb48462354e7d35dee5ad54096c39 100644
|
||||
index 7aee6d9849f0a9c64db0368d2faa03c0633a72a4..40afa9e2cfb4518e9050ccac739aec3215f95d56 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -1,4 +1,5 @@
|
||||
|
@ -20,7 +20,7 @@ index 47df5ac22b0fc97381364eb4d16e33768ff9794c..dfc9ca34656cb48462354e7d35dee5ad
|
|||
|
||||
plugins {
|
||||
java
|
||||
@@ -78,18 +79,24 @@ tasks.jar {
|
||||
@@ -79,18 +80,24 @@ tasks.jar {
|
||||
|
||||
manifest {
|
||||
val git = Git(rootProject.layout.projectDirectory.path)
|
||||
|
@ -659,7 +659,7 @@ index 16d2b3e59b8a6ef65b411afb9d94c61e6d797e36..e4335bfc98272c5499651977625e1f0c
|
|||
public List<CraftPlayer> getOnlinePlayers() {
|
||||
return this.playerView;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 6a3331eb45fdd2199fe41ab624d6dbb85bc04711..15ea3363127f315dc3aeb1482dd8a8637cc1a9e0 100644
|
||||
index 99bc6e3d472edc0a0182e7b53286cb6a0170ae80..44b6fd8a64e7d7756eb62cd3816b1c4dcc5c5927 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -15,6 +15,7 @@ import joptsimple.OptionSet;
|
||||
|
@ -670,7 +670,7 @@ index 6a3331eb45fdd2199fe41ab624d6dbb85bc04711..15ea3363127f315dc3aeb1482dd8a863
|
|||
public static boolean useJline = true;
|
||||
public static boolean useConsole = true;
|
||||
|
||||
@@ -241,15 +242,17 @@ public class Main {
|
||||
@@ -241,7 +242,7 @@ public class Main {
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -14);
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
System.err.println("*** Error, this build is outdated ***");
|
||||
|
@ -679,12 +679,12 @@ index 6a3331eb45fdd2199fe41ab624d6dbb85bc04711..15ea3363127f315dc3aeb1482dd8a863
|
|||
System.err.println("*** Server will start in 20 seconds ***");
|
||||
Thread.sleep(TimeUnit.SECONDS.toMillis(20));
|
||||
}
|
||||
}
|
||||
@@ -249,8 +250,9 @@ public class Main {
|
||||
|
||||
System.setProperty("library.jansi.version", "Paper"); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows
|
||||
System.setProperty("jdk.console", "java.base"); // Paper - revert default console provider back to java.base so we can have our own jline
|
||||
- System.out.println("Loading libraries, please wait...");
|
||||
- net.minecraft.server.Main.main(options);
|
||||
+
|
||||
+ //System.out.println("Loading libraries, please wait...");
|
||||
+ //net.minecraft.server.Main.main(options);
|
||||
+ io.papermc.paper.PaperBootstrap.boot(options);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue