Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-20 01:40:06 +01:00
Ursprung
6c6e1b4ce2
Commit
d6aa1ad509
@ -48,7 +48,7 @@ import com.sk89q.worldedit.regions.CylinderRegion;
|
|||||||
import com.sk89q.worldedit.regions.Polygonal2DRegion;
|
import com.sk89q.worldedit.regions.Polygonal2DRegion;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import com.sk89q.worldedit.regions.RegionSelector;
|
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.World;
|
||||||
import org.bukkit.command.Command;
|
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
|
loadAdapter(); // Need an adapter to work with special blocks with NBT data
|
||||||
|
|
||||||
// Check Java version
|
// Check Java version
|
||||||
Java8Detector.notifyIfNot8();
|
Java7Detector.notifyIfNot8();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadConfig() {
|
private void loadConfig() {
|
||||||
|
@ -18,21 +18,21 @@
|
|||||||
*/
|
*/
|
||||||
package com.sk89q.worldedit.util;
|
package com.sk89q.worldedit.util;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
|
|
||||||
public final class Java8Detector {
|
public final class Java7Detector {
|
||||||
|
|
||||||
public static void notifyIfNot8() {
|
public static void notifyIfNot8() {
|
||||||
|
int major = -1;
|
||||||
|
try {
|
||||||
String[] ver = System.getProperty("java.version").split("\\.");
|
String[] ver = System.getProperty("java.version").split("\\.");
|
||||||
int major = Integer.parseInt(ver[1]);
|
major = Integer.parseInt(ver[1]);
|
||||||
if (major <= 7) {
|
} catch (Exception ignored) {
|
||||||
// Implicitly java 7 because we compile against 7, so this won't
|
}
|
||||||
// even launch on 6.
|
|
||||||
|
if (major == 7) {
|
||||||
WorldEdit.logger.warning(
|
WorldEdit.logger.warning(
|
||||||
"WorldEdit has detected you are using Java 7"
|
"WorldEdit has detected you are using Java 7.");
|
||||||
+ " (based on detected version "
|
|
||||||
+ Joiner.on('.').join(ver) + ").");
|
|
||||||
WorldEdit.logger.warning(
|
WorldEdit.logger.warning(
|
||||||
"WorldEdit will stop supporting Java less than version 8 in the future,"
|
"WorldEdit will stop supporting Java less than version 8 in the future,"
|
||||||
+ " due to Java 7 being EOL since April 2015."
|
+ " due to Java 7 being EOL since April 2015."
|
||||||
@ -40,7 +40,7 @@ public final class Java8Detector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Java8Detector() {
|
private Java7Detector() {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -30,7 +30,6 @@ import com.sk89q.worldedit.event.platform.PlatformReadyEvent;
|
|||||||
import com.sk89q.worldedit.extension.platform.Platform;
|
import com.sk89q.worldedit.extension.platform.Platform;
|
||||||
import com.sk89q.worldedit.forge.net.LeftClickAirEventMessage;
|
import com.sk89q.worldedit.forge.net.LeftClickAirEventMessage;
|
||||||
import com.sk89q.worldedit.internal.LocalWorldAdapter;
|
import com.sk89q.worldedit.internal.LocalWorldAdapter;
|
||||||
import com.sk89q.worldedit.util.Java8Detector;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren