Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-03 14:50:19 +01:00
Check for outdated Java versions older than 16
Dieser Commit ist enthalten in:
Ursprung
070ff46558
Commit
f16f91f469
@ -379,9 +379,40 @@ public class GeyserConnector {
|
|||||||
logger.warning(LanguageUtils.getLocaleStringLog("geyser.core.movement_warn"));
|
logger.warning(LanguageUtils.getLocaleStringLog("geyser.core.movement_warn"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkForOutdatedJava();
|
||||||
|
|
||||||
newsHandler.handleNews(null, NewsItemAction.ON_SERVER_STARTED);
|
newsHandler.handleNews(null, NewsItemAction.ON_SERVER_STARTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkForOutdatedJava() {
|
||||||
|
final int supportedJavaVersion = 16;
|
||||||
|
// Taken from Paper
|
||||||
|
String javaVersion = System.getProperty("java.version");
|
||||||
|
Matcher matcher = Pattern.compile("(?:1\\.)?(\\d+)").matcher(javaVersion);
|
||||||
|
if (!matcher.find()) {
|
||||||
|
getLogger().debug("Could not parse Java version string " + javaVersion);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String version = matcher.group(1);
|
||||||
|
int majorVersion;
|
||||||
|
try {
|
||||||
|
majorVersion = Integer.parseInt(version);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
getLogger().debug("Could not format as an int: " + version);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (majorVersion < supportedJavaVersion) {
|
||||||
|
getLogger().warning("*********************************************");
|
||||||
|
getLogger().warning("");
|
||||||
|
getLogger().warning(LanguageUtils.getLocaleStringLog("geyser.bootstrap.unsupported_java.header"));
|
||||||
|
getLogger().warning(LanguageUtils.getLocaleStringLog("geyser.bootstrap.unsupported_java.message", supportedJavaVersion, javaVersion));
|
||||||
|
getLogger().warning("");
|
||||||
|
getLogger().warning("*********************************************");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
bootstrap.getGeyserLogger().info(LanguageUtils.getLocaleStringLog("geyser.core.shutdown"));
|
bootstrap.getGeyserLogger().info(LanguageUtils.getLocaleStringLog("geyser.core.shutdown"));
|
||||||
shuttingDown = true;
|
shuttingDown = true;
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit c8923b1f71c7f66621729be47dec7f911606c6a1
|
Subproject commit d0cbd4b616be6c057115fdb13d75866b8452893e
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren