Auto tame tameable mounts.

This commit is contained in:
Brianna 2019-10-08 02:01:26 -04:00
parent 6b707436ef
commit 2fe1d506b7
2 changed files with 12 additions and 0 deletions

View File

@ -8,7 +8,9 @@ import com.songoda.epicbosses.holder.ActiveBossHolder;
import com.songoda.epicbosses.mechanics.IBossMechanic; import com.songoda.epicbosses.mechanics.IBossMechanic;
import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.Debug;
import com.songoda.epicbosses.utils.EntityFinder; import com.songoda.epicbosses.utils.EntityFinder;
import org.bukkit.entity.AnimalTamer;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Tameable;
/** /**
* @author Charles Cullen * @author Charles Cullen
@ -45,6 +47,10 @@ public class EntityTypeMechanic implements IBossMechanic {
return false; return false;
} }
if (lowerLivingEntity instanceof Tameable) {
((Tameable) lowerLivingEntity).setTamed(true);
}
lowerLivingEntity.setPassenger(livingEntity); lowerLivingEntity.setPassenger(livingEntity);
} }
} }

View File

@ -8,7 +8,9 @@ import com.songoda.epicbosses.holder.ActiveMinionHolder;
import com.songoda.epicbosses.mechanics.IMinionMechanic; import com.songoda.epicbosses.mechanics.IMinionMechanic;
import com.songoda.epicbosses.utils.Debug; import com.songoda.epicbosses.utils.Debug;
import com.songoda.epicbosses.utils.EntityFinder; import com.songoda.epicbosses.utils.EntityFinder;
import org.bukkit.entity.AnimalTamer;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Tameable;
/** /**
* @author Charles Cullen * @author Charles Cullen
@ -46,6 +48,10 @@ public class EntityTypeMechanic implements IMinionMechanic {
return false; return false;
} }
if (lowerLivingEntity instanceof Tameable) {
((Tameable) lowerLivingEntity).setTamed(true);
}
lowerLivingEntity.setPassenger(livingEntity); lowerLivingEntity.setPassenger(livingEntity);
} }
} }