From 7af3d37675d25d2d6d4ff36b915114ae281fffa6 Mon Sep 17 00:00:00 2001 From: RoboMWM Date: Tue, 4 Oct 2016 19:56:46 -0700 Subject: [PATCH] Warn Java 7 users of their impending doom --- .../GriefPrevention/GriefPrevention.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 532b4c4..c876dd8 100644 --- a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -764,12 +764,24 @@ public class GriefPrevention extends JavaPlugin this.config_logs_mutedChatEnabled = config.getBoolean("GriefPrevention.Abridged Logs.Included Entry Types.Muted Chat Messages", false); //claims mode by world - for(World world : this.config_claims_worldModes.keySet()) - { - outConfig.set( - "GriefPrevention.Claims.Mode." + world.getName(), - this.config_claims_worldModes.get(world).name()); - } + try + { + for(World world : this.config_claims_worldModes.keySet()) + { + outConfig.set( + "GriefPrevention.Claims.Mode." + world.getName(), + this.config_claims_worldModes.get(world).name()); + } + } + catch(NoSuchMethodError e) + { + this.getLogger().severe("You are running an old version of Java which is susceptible to security exploits. Please update to Java 8."); + this.getLogger().severe("If you are on a shared host, tell your hosting provider to update, as Java 7 is End of Life."); + this.getLogger().severe("If they refuse, I'd suggesting switching to a more secure and responsive host."); + this.getLogger().severe("But if you truly have absolutely no choice, then please download the Java 7 version of GriefPrevention."); + this.onDisable(); + } + outConfig.set("GriefPrevention.Claims.PreventTheft", this.config_claims_preventTheft); outConfig.set("GriefPrevention.Claims.ProtectCreatures", this.config_claims_protectCreatures);