-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
4e01ede
commit d8b66dd
Showing
12 changed files
with
37 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ Other changes: | |
Co-Authored-By: Emilia Kond <[email protected]> | ||
|
||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index 220d2696bf40d1657c87d049f563ccfffed2e8ad..c808f36b30d0f8edb8365875039fd20b8c20007d 100644 | ||
index 220d2696bf40d1657c87d049f563ccfffed2e8ad..99e44684a3f6340ed3c0f73c690a9d4d51872f0d 100644 | ||
--- a/build.gradle.kts | ||
+++ b/build.gradle.kts | ||
@@ -5,6 +5,12 @@ plugins { | ||
|
@@ -41,13 +41,14 @@ index 220d2696bf40d1657c87d049f563ccfffed2e8ad..c808f36b30d0f8edb8365875039fd20b | |
// Paper start - configure mockito agent that is needed in newer java versions | ||
val mockitoAgent = configurations.register("mockitoAgent") | ||
abstract class MockitoAgentProvider : CommandLineArgumentProvider { | ||
@@ -19,7 +25,21 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { | ||
@@ -19,7 +25,22 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { | ||
|
||
dependencies { | ||
implementation(project(":paper-api")) | ||
- implementation("jline:jline:2.12.1") | ||
+ // Paper start | ||
+ implementation("org.jline:jline-terminal-jansi:3.21.0") | ||
+ implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ | ||
+ implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21 | ||
+ implementation("net.minecrell:terminalconsoleappender:1.3.0") | ||
+ implementation("net.kyori:adventure-text-serializer-ansi:4.17.0") // Keep in sync with adventureVersion from Paper-API build file | ||
+ /* | ||
|
@@ -64,7 +65,7 @@ index 220d2696bf40d1657c87d049f563ccfffed2e8ad..c808f36b30d0f8edb8365875039fd20b | |
implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion | ||
implementation("org.ow2.asm:asm-commons:9.7.1") | ||
implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files | ||
@@ -92,6 +112,19 @@ tasks.check { | ||
@@ -92,6 +113,19 @@ tasks.check { | ||
dependsOn(scanJar) | ||
} | ||
// Paper end | ||
|
@@ -401,7 +402,7 @@ index 1333daa8666fe2ec4033a2f57ba6b716fcdd5343..8daa027a94602d7d556cf4fbfc8fcd97 | |
|
||
this.bans = new UserBanList(PlayerList.USERBANLIST_FILE); | ||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
index c3fc8b1abe843a19347509947f4b864c1b417800..e497da2dba83779c4ad1c45cea133bddadf61446 100644 | ||
index c3774d9a253d4fda80f63d4040722ab5c1c94be4..41aa22f431c989d60dde5c85ca2821d5bcf613af 100644 | ||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
@@ -43,7 +43,7 @@ import java.util.logging.Level; | ||
|
@@ -428,7 +429,7 @@ index c3fc8b1abe843a19347509947f4b864c1b417800..e497da2dba83779c4ad1c45cea133bdd | |
@Override | ||
public PluginCommand getPluginCommand(String name) { | ||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java | ||
index 2e33acc428dbfd3e123dfd6ef90bc020b8a08daf..4a99cf5a146abe0d2b40ffc1189fdc5540f14d55 100644 | ||
index 41ceea1093edbf777f9ebe252114be7f75438420..b6e449c2f29b0a201e5e7495de81d21a19f67a25 100644 | ||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java | ||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java | ||
@@ -13,7 +13,6 @@ import java.util.logging.Logger; | ||
|
@@ -467,11 +468,12 @@ index 2e33acc428dbfd3e123dfd6ef90bc020b8a08daf..4a99cf5a146abe0d2b40ffc1189fdc55 | |
} | ||
|
||
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { | ||
@@ -231,6 +241,7 @@ public class Main { | ||
@@ -231,6 +241,8 @@ 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); | ||
} catch (Throwable t) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,18 @@ Subject: [PATCH] Plugin remapping | |
Co-authored-by: Nassim Jahnke <[email protected]> | ||
|
||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index 429fcd5927cf3259e8cdc83fadf78b41a38eb3bf..fa3476acb77ce5d1247244808ead5b2a994e5fc7 100644 | ||
index dd7900a126ab35ed00af5653a35d361d175f6f76..8678e5bd59a7e085cb1b4e38f29e06ce36d2c1de 100644 | ||
--- a/build.gradle.kts | ||
+++ b/build.gradle.kts | ||
@@ -60,6 +60,7 @@ dependencies { | ||
@@ -61,6 +61,7 @@ dependencies { | ||
testImplementation("org.ow2.asm:asm-tree:9.7.1") | ||
testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest | ||
implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling | ||
+ implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins | ||
} | ||
|
||
paperweight { | ||
@@ -187,20 +188,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM | ||
@@ -188,20 +189,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM | ||
runtime.filterNot { it.asFile.absolutePath == vanilla } | ||
} | ||
|
||
|
@@ -1904,7 +1904,7 @@ index 0000000000000000000000000000000000000000..73b20a92f330311e3fef8f03b51a0985 | |
+ } | ||
+} | ||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
index 600e865688b423d9bb4338f413dc28418ba37748..ad699a4ad555a4d7c85727bd835ebacd24d02c2b 100644 | ||
index 542ff64ce0cb93a9f996fa0a65e8dde7ed39c3a9..5c54c5c525c86bb8037982435b8769ec2ca2c6cb 100644 | ||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
@@ -1005,6 +1005,7 @@ public final class CraftServer implements Server { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,10 @@ Subject: [PATCH] Remap reflection calls in plugins using internals | |
Co-authored-by: Jason Penilla <[email protected]> | ||
|
||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index fa3476acb77ce5d1247244808ead5b2a994e5fc7..47df5ac22b0fc97381364eb4d16e33768ff9794c 100644 | ||
index 24f3d0c96fe9d70b1a7cf528e09ebfc4366577ed..7aee6d9849f0a9c64db0368d2faa03c0633a72a4 100644 | ||
--- a/build.gradle.kts | ||
+++ b/build.gradle.kts | ||
@@ -61,6 +61,12 @@ dependencies { | ||
@@ -62,6 +62,12 @@ dependencies { | ||
testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest | ||
implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling | ||
implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ Co-authored-by: Jake Potrebic <[email protected]> | |
Co-authored-by: masmc05 <[email protected]> | ||
|
||
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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters