diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java index 49181a4..4a43ecf 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/EntityTypeMechanic.java @@ -8,6 +8,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.mechanics.IBossMechanic; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.EntityFinder; +import org.bukkit.entity.Ageable; import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Tameable; @@ -47,10 +48,6 @@ public class EntityTypeMechanic implements IBossMechanic { return false; } - if (lowerLivingEntity instanceof Tameable) { - ((Tameable) lowerLivingEntity).setTamed(true); - } - lowerLivingEntity.setPassenger(livingEntity); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java index 795f397..066633b 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/minions/EntityTypeMechanic.java @@ -8,6 +8,7 @@ import com.songoda.epicbosses.holder.ActiveMinionHolder; import com.songoda.epicbosses.mechanics.IMinionMechanic; import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.EntityFinder; +import org.bukkit.entity.Ageable; import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Tameable; @@ -48,10 +49,6 @@ public class EntityTypeMechanic implements IMinionMechanic { return false; } - if (lowerLivingEntity instanceof Tameable) { - ((Tameable) lowerLivingEntity).setTamed(true); - } - lowerLivingEntity.setPassenger(livingEntity); } } diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java index 72600df..4be5b41 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/utils/EntityFinder.java @@ -3,8 +3,10 @@ package com.songoda.epicbosses.utils; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.entity.handlers.*; import org.bukkit.Location; +import org.bukkit.entity.Ageable; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Tameable; import java.util.ArrayList; import java.util.Arrays; @@ -132,6 +134,14 @@ public enum EntityFinder { return null; } + if (livingEntity instanceof Tameable) { + ((Tameable) livingEntity).setTamed(true); + } + + if (livingEntity instanceof Ageable) { + ((Ageable) livingEntity).setAdult(); + } + return livingEntity; } else { return (LivingEntity) location.getWorld().spawnEntity(location, getEntityType());