Fixed a loading issue with latest MythicMobs

This commit is contained in:
Aria Sangarin 2020-02-11 18:59:52 +01:00
parent d9f0444df0
commit 03573a343a

View File

@ -8,6 +8,9 @@ import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandMap; import org.bukkit.command.CommandMap;
import org.bukkit.configuration.file.FileConfiguration; 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.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable; 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) if (Bukkit.getPluginManager().getPlugin("Vault") != null)
economy = new VaultEconomy(); economy = new VaultEconomy();
@ -212,11 +225,6 @@ public class MMOCore extends JavaPlugin {
getLogger().log(Level.INFO, "Hooked onto MyPet"); 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 * resource regeneration. must check if entity is dead otherwise regen
* will make the 'respawn' button glitched plus HURT entity effect bug * will make the 'respawn' button glitched plus HURT entity effect bug