From 9333bf28519ab682bb727c78a52c33d66011d0a7 Mon Sep 17 00:00:00 2001 From: zml Date: Fri, 16 Jan 2015 19:05:13 -0800 Subject: [PATCH] Add better incompatible version warning essage --- .../permissions/bukkit/PermissionsEx.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/ru/tehkode/permissions/bukkit/PermissionsEx.java b/src/main/java/ru/tehkode/permissions/bukkit/PermissionsEx.java index 846f4860e..2a87421a3 100644 --- a/src/main/java/ru/tehkode/permissions/bukkit/PermissionsEx.java +++ b/src/main/java/ru/tehkode/permissions/bukkit/PermissionsEx.java @@ -25,6 +25,7 @@ import java.util.logging.Level; import java.util.logging.LogRecord; +import com.google.common.cache.CacheBuilder; import com.zachsthings.netevents.NetEventsPlugin; import net.gravitydevelopment.updater.Updater; import org.bukkit.ChatColor; @@ -160,6 +161,17 @@ public void onEnable() { return; } try { + try { + CacheBuilder.class.getMethod("maximumSize", long.class); + } catch (NoSuchMethodException e) { + getLogger().severe("================================================================================="); + getLogger().severe("As of version 1.23, PEX is only compatible with versions of Minecraft 1.8 or greater. " + + "Please downgrade to the most recent 1.22.x series version of PEX to continue."); + getLogger().severe("================================================================================="); + getPluginLoader().disablePlugin(this); + return; + } + if (this.permissionsManager == null) { this.permissionsManager = new PermissionManager(config, getLogger(), this); } @@ -167,12 +179,12 @@ public void onEnable() { try { OfflinePlayer.class.getMethod("getUniqueId"); } catch (NoSuchMethodException e) { - getLogger().severe("============================================================================================"); + getLogger().severe("================================================================================="); getLogger().severe("As of version 1.21, PEX requires a version of Bukkit with UUID support to function (>1.7.5). Please download a non-UUID version of PermissionsEx to continue."); getLogger().severe("Beginning reversion of potential invalid UUID conversion"); getPermissionsManager().getBackend().revertUUID(); getLogger().severe("Reversion complete, disabling. PermissionsEx will not work until downgrade is complete"); - getLogger().severe("============================================================================================"); + getLogger().severe("================================================================================="); getPluginLoader().disablePlugin(this); return; }