diff --git a/src/main/java/net/Indyuce/mmocore/MMOCore.java b/src/main/java/net/Indyuce/mmocore/MMOCore.java index ad5c8ef5..19cc046b 100644 --- a/src/main/java/net/Indyuce/mmocore/MMOCore.java +++ b/src/main/java/net/Indyuce/mmocore/MMOCore.java @@ -8,9 +8,6 @@ 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; @@ -176,15 +173,10 @@ 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("MythicMobs") != null) { + Bukkit.getServer().getPluginManager().registerEvents(new MythicMobsDrops(), this); + getLogger().log(Level.INFO, "Hooked onto MythicMobs"); + } if (Bukkit.getPluginManager().getPlugin("Vault") != null) economy = new VaultEconomy(); diff --git a/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/MythicMobsDrops.java b/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/MythicMobsDrops.java index 7bb012c3..8cb91551 100644 --- a/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/MythicMobsDrops.java +++ b/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/MythicMobsDrops.java @@ -47,5 +47,6 @@ public class MythicMobsDrops implements Listener { private void registerPlaceholders() { MythicMobs.inst().getPlaceholderManager().register("mmocore.skill", Placeholder.meta((metadata, arg) -> String.valueOf(PlayerData.get(metadata.getCaster().getEntity().getUniqueId()).getSkillData().getCachedModifier(arg)))); MythicMobs.inst().getPlaceholderManager().register("mmocore.mana", Placeholder.meta((metadata, arg) -> String.valueOf((int) PlayerData.get(metadata.getCaster().getEntity().getUniqueId()).getMana()))); + MythicMobs.inst().getPlaceholderManager().register("mmocore.stamina", Placeholder.meta((metadata, arg) -> String.valueOf((int) PlayerData.get(metadata.getCaster().getEntity().getUniqueId()).getStamina()))); } } \ No newline at end of file