Fixed skill placeholders. Added <mmocore.stamina>

This commit is contained in:
Indyuce 2020-02-17 00:30:14 +01:00
parent e06f70e158
commit ee92f16003
2 changed files with 5 additions and 12 deletions

View File

@ -8,9 +8,6 @@ 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;
@ -176,15 +173,10 @@ public class MMOCore extends JavaPlugin {
} }
}); });
Bukkit.getPluginManager().registerEvents(new Listener() { if (Bukkit.getPluginManager().getPlugin("MythicMobs") != null) {
@EventHandler Bukkit.getServer().getPluginManager().registerEvents(new MythicMobsDrops(), this);
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"); 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();

View File

@ -47,5 +47,6 @@ public class MythicMobsDrops implements Listener {
private void registerPlaceholders() { 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.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.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())));
} }
} }