diff --git a/Changelog.txt b/Changelog.txt index 8d7801218..480521cd1 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -6,6 +6,9 @@ Key: = Fix ! Change - Removal +Version 2.2.0 + Fixed a bug where grabbing the version of WG would throw classnotdefined errors + Version 2.1.8 mcMMO now checks for WG 7 before attempting to use the WG API Made some optimizations for our WG integration diff --git a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java index d687fc908..fd191669b 100644 --- a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java +++ b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java @@ -21,18 +21,6 @@ public class WorldGuardUtils { if (plugin == null) { return false; // Maybe you want throw an exception instead } - - if(!WorldGuard.getVersion().startsWith("7")) - { - if(!hasWarned) - { - mcMMO.p.getLogger().severe("mcMMO only supports WorldGuard version 7! Make sure you have WG 7! This warning will not appear again."); - hasWarned = true; - } - - return false; // WG 7 is required - } - } catch (Exception e) { e.printStackTrace(); //Silently Fail @@ -53,10 +41,20 @@ public class WorldGuardUtils { if(plugin instanceof WorldGuardPlugin) { - worldGuardPluginRef = (WorldGuardPlugin) plugin; + if(plugin.getDescription().getVersion().startsWith("7")) + { + worldGuardPluginRef = (WorldGuardPlugin) plugin; - if(worldGuardPluginRef != null) - isLoaded = true; + if(worldGuardPluginRef != null) + isLoaded = true; + + } else { + if(!hasWarned) + { + mcMMO.p.getLogger().severe("mcMMO only supports WorldGuard version 7! Make sure you have WG 7! This warning will not appear again."); + hasWarned = true; + } + } } return worldGuardPluginRef;