From 878010255cbed694d0cb161a1c53fc79aab4aa72 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 28 Nov 2016 18:01:41 +1100 Subject: [PATCH] Java 9 --- Core/src/main/java/com/intellectualcrafters/plot/PS.java | 4 ++-- .../src/main/java/com/intellectualcrafters/plot/config/C.java | 4 ++-- .../java/com/intellectualcrafters/plot/util/EventUtil.java | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/PS.java b/Core/src/main/java/com/intellectualcrafters/plot/PS.java index 3a4b10c65..02c4c289a 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/PS.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/PS.java @@ -149,7 +149,7 @@ public class PS { } } if (getJavaVersion() < 1.8) { - PS.log(C.CONSOLE_JAVA_OUTDATED_1_8.f(IMP.getPluginName())); + PS.log(C.CONSOLE_JAVA_OUTDATED.f(IMP.getPluginName())); } TaskManager.IMP = this.IMP.getTaskManager(); setupConfigs(); @@ -2008,7 +2008,7 @@ public class PS { * Get the Java version. * @return the java version */ - private double getJavaVersion() { + public double getJavaVersion() { return Double.parseDouble(System.getProperty("java.specification.version")); } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/config/C.java b/Core/src/main/java/com/intellectualcrafters/plot/config/C.java index a3efbe71c..1aed01381 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -158,8 +158,8 @@ public enum C { /* * Static console */ - CONSOLE_JAVA_OUTDATED_1_8("&cYour version of java is outdated. It is highly recommended that you update to Java 8 as it increases performance " - + "and security. %s0 will require Java 9 in a future update.", "static.console"), + CONSOLE_JAVA_OUTDATED("&cYour version of java is outdated. It is highly recommended that you update to Java 8 as it increases performance " + + "and security. %s0 will require Java 8 in a future update.", "static.console"), CONSOLE_PLEASE_ENABLE_METRICS("&dPlease enable metrics for %s0. Using metrics improves plugin stability, performance, and features. " + "Bug fixes and new features are influenced on metrics.", "static.console"), /* diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java b/Core/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java index 6e85915d1..343679a76 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/EventUtil.java @@ -71,7 +71,9 @@ public abstract class EventUtil { } } if (PS.get().update != null && Permissions.hasPermission(player, C.PERMISSION_ADMIN_UPDATE) && Settings.Enabled_Components.UPDATER) { - MainUtil.sendMessage(player,C.CONSOLE_JAVA_OUTDATED_1_8.f(PS.get().IMP.getPluginName())); + if (PS.get().getJavaVersion() < 1.8) { + MainUtil.sendMessage(player, C.CONSOLE_JAVA_OUTDATED.f(PS.get().IMP.getPluginName())); + } MainUtil.sendMessage(player, "&6An update for " + PS.imp().getPluginName() + " is available: &7/plot update"); } final Plot plot = player.getCurrentPlot();