mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Grab the version of WG in a better way
This commit is contained in:
parent
36f75457e3
commit
577e3339f1
@ -6,6 +6,9 @@ Key:
|
|||||||
= Fix
|
= Fix
|
||||||
! Change
|
! Change
|
||||||
- Removal
|
- Removal
|
||||||
|
Version 2.2.0
|
||||||
|
Fixed a bug where grabbing the version of WG would throw classnotdefined errors
|
||||||
|
|
||||||
Version 2.1.8
|
Version 2.1.8
|
||||||
mcMMO now checks for WG 7 before attempting to use the WG API
|
mcMMO now checks for WG 7 before attempting to use the WG API
|
||||||
Made some optimizations for our WG integration
|
Made some optimizations for our WG integration
|
||||||
|
@ -21,18 +21,6 @@ public class WorldGuardUtils {
|
|||||||
if (plugin == null) {
|
if (plugin == null) {
|
||||||
return false; // Maybe you want throw an exception instead
|
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) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
//Silently Fail
|
//Silently Fail
|
||||||
@ -53,10 +41,20 @@ public class WorldGuardUtils {
|
|||||||
|
|
||||||
if(plugin instanceof WorldGuardPlugin)
|
if(plugin instanceof WorldGuardPlugin)
|
||||||
{
|
{
|
||||||
worldGuardPluginRef = (WorldGuardPlugin) plugin;
|
if(plugin.getDescription().getVersion().startsWith("7"))
|
||||||
|
{
|
||||||
|
worldGuardPluginRef = (WorldGuardPlugin) plugin;
|
||||||
|
|
||||||
if(worldGuardPluginRef != null)
|
if(worldGuardPluginRef != null)
|
||||||
isLoaded = true;
|
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;
|
return worldGuardPluginRef;
|
||||||
|
Loading…
Reference in New Issue
Block a user