3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-20 01:40:06 +01:00

Make Java 8 detection work on Java 9

Closes #393.
Dieser Commit ist enthalten in:
Kenzie Togami 2017-08-16 16:39:37 -07:00
Ursprung 6c6e1b4ce2
Commit d6aa1ad509
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 5D200B325E157A81
3 geänderte Dateien mit 13 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -48,7 +48,7 @@ import com.sk89q.worldedit.regions.CylinderRegion;
import com.sk89q.worldedit.regions.Polygonal2DRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.util.Java8Detector;
import com.sk89q.worldedit.util.Java7Detector;
import org.bukkit.World;
import org.bukkit.command.Command;
@ -121,7 +121,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter {
loadAdapter(); // Need an adapter to work with special blocks with NBT data
// Check Java version
Java8Detector.notifyIfNot8();
Java7Detector.notifyIfNot8();
}
private void loadConfig() {

Datei anzeigen

@ -18,21 +18,21 @@
*/
package com.sk89q.worldedit.util;
import com.google.common.base.Joiner;
import com.sk89q.worldedit.WorldEdit;
public final class Java8Detector {
public final class Java7Detector {
public static void notifyIfNot8() {
int major = -1;
try {
String[] ver = System.getProperty("java.version").split("\\.");
int major = Integer.parseInt(ver[1]);
if (major <= 7) {
// Implicitly java 7 because we compile against 7, so this won't
// even launch on 6.
major = Integer.parseInt(ver[1]);
} catch (Exception ignored) {
}
if (major == 7) {
WorldEdit.logger.warning(
"WorldEdit has detected you are using Java 7"
+ " (based on detected version "
+ Joiner.on('.').join(ver) + ").");
"WorldEdit has detected you are using Java 7.");
WorldEdit.logger.warning(
"WorldEdit will stop supporting Java less than version 8 in the future,"
+ " due to Java 7 being EOL since April 2015."
@ -40,7 +40,7 @@ public final class Java8Detector {
}
}
private Java8Detector() {
private Java7Detector() {
}
}

Datei anzeigen

@ -30,7 +30,6 @@ import com.sk89q.worldedit.event.platform.PlatformReadyEvent;
import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.forge.net.LeftClickAirEventMessage;
import com.sk89q.worldedit.internal.LocalWorldAdapter;
import com.sk89q.worldedit.util.Java8Detector;
import java.io.File;
import java.util.Map;