9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-21 07:59:26 +00:00
Files
Leaf/patches/server/0073-Fix-console-freeze-above-JAVA-22.patch
2024-08-11 23:07:59 +08:00

20 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Sat, 4 May 2024 02:46:17 -0400
Subject: [PATCH] Fix console freeze above JAVA 22
Revert to old console provider, Fix https://github.com/PaperMC/Paper/issues/10405
Solution refers to https://inside.java/2023/07/31/quality-heads-up
diff --git a/src/main/java/org/dreeam/leaf/LeafBootstrap.java b/src/main/java/org/dreeam/leaf/LeafBootstrap.java
index 9a9bd633c6ed1b2231d36ef7a285a1f1463ccee4..780affb51ebddcd05729c8e3272e28630bed8077 100644
--- a/src/main/java/org/dreeam/leaf/LeafBootstrap.java
+++ b/src/main/java/org/dreeam/leaf/LeafBootstrap.java
@@ -13,5 +13,6 @@ public class LeafBootstrap {
private static void runPreBootTasks() {
System.setProperty("org.jline.terminal.disableDeprecatedProviderWarning", "true"); // Leaf - Ignore terminal provider warning
+ if (org.galemc.gale.virtualthread.VirtualThreadService.getJavaMajorVersion() >= 22) System.setProperty("jdk.console", "java.base"); // Leaf - Fix console freeze above JAVA 22
}
}