From a26d19716d399e23c7f17e9eb9845d1cda6dc2c4 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Sun, 22 Dec 2019 15:04:58 +0100 Subject: [PATCH] !Fix incompatible version enable error message --- src/main/java/net/Indyuce/mmoitems/MMOItems.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/Indyuce/mmoitems/MMOItems.java b/src/main/java/net/Indyuce/mmoitems/MMOItems.java index 5bcbc8d1..8915655e 100644 --- a/src/main/java/net/Indyuce/mmoitems/MMOItems.java +++ b/src/main/java/net/Indyuce/mmoitems/MMOItems.java @@ -115,7 +115,6 @@ public class MMOItems extends JavaPlugin { getLogger().log(Level.INFO, "Your server version is not compatible."); Bukkit.getPluginManager().disablePlugin(this); return; - // nms = new NMSHandler_Reflection(); } try { @@ -136,6 +135,15 @@ public class MMOItems extends JavaPlugin { } public void onEnable() { + + /* + * server version compatibility checks are ran when the plugin loads. if + * the nms object is null, it means the version is not compatible + * therefore MI should not enable + */ + if (nms == null) + return; + new SpigotPlugin(39267, this).checkForUpdate(); new MMOItemsMetrics(); @@ -376,11 +384,11 @@ public class MMOItems extends JavaPlugin { public AbilityManager getAbilities() { return abilityManager; } - + public BlockManager getCustomBlocks() { return blockManager; } - + public WorldGenManager getWorldGen() { return worldGenManager; }