Fixed MM compatibility

This commit is contained in:
Indyuce 2020-03-19 15:47:49 +01:00
parent 1cd0573592
commit 208d5d18b1
2 changed files with 6 additions and 29 deletions

View File

@ -38,7 +38,7 @@ import net.Indyuce.mmocore.comp.holograms.CMIPlugin;
import net.Indyuce.mmocore.comp.holograms.HologramSupport;
import net.Indyuce.mmocore.comp.holograms.HologramsPlugin;
import net.Indyuce.mmocore.comp.holograms.HolographicDisplaysPlugin;
import net.Indyuce.mmocore.comp.mythicmobs.MythicMobsEnableListener;
import net.Indyuce.mmocore.comp.mythicmobs.MythicMobsDrops;
import net.Indyuce.mmocore.comp.mythicmobs.MythicMobsMMOLoader;
import net.Indyuce.mmocore.comp.placeholder.DefaultParser;
import net.Indyuce.mmocore.comp.placeholder.PlaceholderAPIParser;
@ -177,8 +177,6 @@ public class MMOCore extends JavaPlugin {
if (getConfig().contains("mysql") && getConfig().getBoolean("mysql.enabled"))
dataProvider = new MySQLDataProvider();
Bukkit.getPluginManager().registerEvents(new MythicMobsEnableListener(), this);
if (Bukkit.getPluginManager().getPlugin("Vault") != null)
economy = new VaultEconomy();
@ -214,6 +212,11 @@ public class MMOCore extends JavaPlugin {
getLogger().log(Level.INFO, "Hooked onto ShopKeepers");
}
if (Bukkit.getPluginManager().getPlugin("MythicMobs") != null) {
Bukkit.getServer().getPluginManager().registerEvents(new MythicMobsDrops(), this);
MMOCore.plugin.getLogger().log(Level.INFO, "Hooked onto MythicMobs");
}
if (Bukkit.getPluginManager().getPlugin("MyPet") != null) {
entities.registerHandler(new MyPetEntityHandler());
getLogger().log(Level.INFO, "Hooked onto MyPet");

View File

@ -1,26 +0,0 @@
package net.Indyuce.mmocore.comp.mythicmobs;
//package fuck.im.so.dead;
import java.util.logging.Level;
//import plz.dont.hurt.me.Indy;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.server.PluginEnableEvent;
import net.Indyuce.mmocore.MMOCore;
//Wooooow
public class MythicMobsEnableListener /**This is for fixing a bug, not just stupid code, plz plz plz*/ implements Listener /**here my lovely indy, it's a bug fix*/ {
@EventHandler //For handling this very cool class
public void iloveyoupleasedonthurtme(PluginEnableEvent /**See this event is super cool, but I understand why you'd dislike this "fix"*/ imsorryindy) {
if (imsorryindy.getPlugin().getName().equals("MythicMobs")) /**The load order issue isn't caused by anyone, but I wish we could have an easier fix*/ {
Bukkit.getServer().getPluginManager().registerEvents(new MythicMobsDrops(), MMOCore.plugin);
//Can you even safely register an event within a listener and an eventhandler method?? I don't know, but it works for now!
MMOCore.plugin.getLogger().log(Level.INFO, "Hooked onto MythicMobs"); //PLEASE LOG MY DEATH WHEN INDY SLITS MY THROAT, I'M SCARED
}
}
}
//Love from Aria