From 03573a343a0484655b0ad280df8cfb6064e963ab Mon Sep 17 00:00:00 2001 From: Aria Sangarin Date: Tue, 11 Feb 2020 18:59:52 +0100 Subject: [PATCH] Fixed a loading issue with latest MythicMobs --- src/main/java/net/Indyuce/mmocore/MMOCore.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/MMOCore.java b/src/main/java/net/Indyuce/mmocore/MMOCore.java index 29a642e1..79cfd57c 100644 --- a/src/main/java/net/Indyuce/mmocore/MMOCore.java +++ b/src/main/java/net/Indyuce/mmocore/MMOCore.java @@ -8,6 +8,9 @@ import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandMap; import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; @@ -172,6 +175,16 @@ public class MMOCore extends JavaPlugin { } }); + Bukkit.getPluginManager().registerEvents(new Listener() { + @EventHandler + public void pluginLoad(PluginEnableEvent event) { + if (event.getPlugin().getName().equals("MythicMobs")) { + Bukkit.getServer().getPluginManager().registerEvents(new MythicMobsDrops(), plugin); + getLogger().log(Level.INFO, "Hooked onto MythicMobs"); + } + } + }, plugin); + if (Bukkit.getPluginManager().getPlugin("Vault") != null) economy = new VaultEconomy(); @@ -212,11 +225,6 @@ public class MMOCore extends JavaPlugin { getLogger().log(Level.INFO, "Hooked onto MyPet"); } - if (Bukkit.getPluginManager().getPlugin("MythicMobs") != null) { - Bukkit.getServer().getPluginManager().registerEvents(new MythicMobsDrops(), this); - getLogger().log(Level.INFO, "Hooked onto MythicMobs"); - } - /* * resource regeneration. must check if entity is dead otherwise regen * will make the 'respawn' button glitched plus HURT entity effect bug