diff --git a/pom.xml b/pom.xml index bfd90018..e53bd2e8 100644 --- a/pom.xml +++ b/pom.xml @@ -122,7 +122,7 @@ io.lumine MythicLib - 1.0.2 + 1.0.8-SNAPSHOT provided diff --git a/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/skill/PassiveSkillType.java b/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/skill/PassiveSkillType.java index ac795ab5..b1417c7d 100644 --- a/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/skill/PassiveSkillType.java +++ b/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/skill/PassiveSkillType.java @@ -1,11 +1,6 @@ package net.Indyuce.mmocore.comp.mythicmobs.skill; -import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.EntityDeathSkillHandler; -import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.PlayerAttackSkillHandler; -import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.PlayerDamageByEntitySkillHandler; -import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.PlayerDamageSkillHandler; -import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.PlayerDeathSkillHandler; -import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.ShootBowSkillHandler; +import net.Indyuce.mmocore.comp.mythicmobs.skill.handlers.*; public enum PassiveSkillType { PLAYER_ATTACK, @@ -13,6 +8,7 @@ public enum PassiveSkillType { PLAYER_DAMAGE_BY_ENTITY, PLAYER_DEATH, PLAYER_KILL_ENTITY, + PLAYER_LOGIN, SHOOT_BOW; public PassiveMythicMobSkillHandler getHandler(MythicMobSkill skill) { @@ -28,6 +24,8 @@ public enum PassiveSkillType { return new PlayerDeathSkillHandler(skill); if (this == SHOOT_BOW) return new ShootBowSkillHandler(skill); + if (this == PLAYER_LOGIN) + return new PlayerLoginSkillHandler(skill); throw new NullPointerException(); } } diff --git a/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/skill/handlers/PlayerLoginSkillHandler.java b/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/skill/handlers/PlayerLoginSkillHandler.java new file mode 100644 index 00000000..fe0b8171 --- /dev/null +++ b/src/main/java/net/Indyuce/mmocore/comp/mythicmobs/skill/handlers/PlayerLoginSkillHandler.java @@ -0,0 +1,24 @@ +package net.Indyuce.mmocore.comp.mythicmobs.skill.handlers; + +import net.Indyuce.mmocore.api.player.PlayerData; +import net.Indyuce.mmocore.comp.mythicmobs.skill.MythicMobSkill; +import net.Indyuce.mmocore.comp.mythicmobs.skill.PassiveMythicMobSkillHandler; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerLoginEvent; + +public class PlayerLoginSkillHandler extends PassiveMythicMobSkillHandler { + /** + * Core class for all passive types + * + * @param skill + */ + public PlayerLoginSkillHandler(MythicMobSkill skill) { + super(skill); + } + + @EventHandler + private void event(PlayerLoginEvent e){ + castSkill(PlayerData.get((Player) e)); + } +}