No spawning babies.

This commit is contained in:
Brianna 2019-10-08 02:26:05 -04:00
parent 73c5ec1efd
commit 50847321ad
3 changed files with 12 additions and 8 deletions

View File

@ -8,6 +8,7 @@ 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.Ageable;
import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.AnimalTamer;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Tameable; import org.bukkit.entity.Tameable;
@ -47,10 +48,6 @@ 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,6 +8,7 @@ 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.Ageable;
import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.AnimalTamer;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Tameable; import org.bukkit.entity.Tameable;
@ -48,10 +49,6 @@ public class EntityTypeMechanic implements IMinionMechanic {
return false; return false;
} }
if (lowerLivingEntity instanceof Tameable) {
((Tameable) lowerLivingEntity).setTamed(true);
}
lowerLivingEntity.setPassenger(livingEntity); lowerLivingEntity.setPassenger(livingEntity);
} }
} }

View File

@ -3,8 +3,10 @@ package com.songoda.epicbosses.utils;
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler; import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
import com.songoda.epicbosses.utils.entity.handlers.*; import com.songoda.epicbosses.utils.entity.handlers.*;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Tameable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -132,6 +134,14 @@ public enum EntityFinder {
return null; return null;
} }
if (livingEntity instanceof Tameable) {
((Tameable) livingEntity).setTamed(true);
}
if (livingEntity instanceof Ageable) {
((Ageable) livingEntity).setAdult();
}
return livingEntity; return livingEntity;
} else { } else {
return (LivingEntity) location.getWorld().spawnEntity(location, getEntityType()); return (LivingEntity) location.getWorld().spawnEntity(location, getEntityType());