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