3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-25 15:50:14 +01:00

Check for outdated Java versions older than 16

Dieser Commit ist enthalten in:
Camotoy 2021-07-23 19:51:46 -04:00
Ursprung 070ff46558
Commit f16f91f469
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 32 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -379,9 +379,40 @@ public class GeyserConnector {
logger.warning(LanguageUtils.getLocaleStringLog("geyser.core.movement_warn"));
}
checkForOutdatedJava();
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() {
bootstrap.getGeyserLogger().info(LanguageUtils.getLocaleStringLog("geyser.core.shutdown"));
shuttingDown = true;

@ -1 +1 @@
Subproject commit c8923b1f71c7f66621729be47dec7f911606c6a1
Subproject commit d0cbd4b616be6c057115fdb13d75866b8452893e