Check we're dealing with the type of mob whose class we're in, fixes #274

This commit is contained in:
Electroblob77
2019-10-05 23:13:48 +01:00
parent bc2037f74e
commit 591cfb5857
3 changed files with 3 additions and 3 deletions
@@ -392,7 +392,7 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
@SubscribeEvent
public static void onCheckSpawnEvent(LivingSpawnEvent.CheckSpawn event){
// We have no way of checking if it's a spawner in getCanSpawnHere() so this has to be done here instead
if(!event.isSpawner()){
if(event.getEntityLiving() instanceof EntityEvilWizard && !event.isSpawner()){
if(!ArrayUtils.contains(Wizardry.settings.mobSpawnDimensions, event.getWorld().provider.getDimension()))
event.setResult(Event.Result.DENY);
}
@@ -197,7 +197,7 @@ public class EntityIceWraith extends EntityBlazeMinion {
@SubscribeEvent
public static void onCheckSpawnEvent(LivingSpawnEvent.CheckSpawn event){
// We have no way of checking if it's a spawner in getCanSpawnHere() so this has to be done here instead
if(!event.isSpawner()){
if(event.getEntityLiving() instanceof EntityLightningWraith && !event.isSpawner()){
if(!ArrayUtils.contains(Wizardry.settings.mobSpawnDimensions, event.getWorld().provider.getDimension()))
event.setResult(Event.Result.DENY);
}
@@ -89,7 +89,7 @@ public class EntityLightningWraith extends EntityBlazeMinion {
@SubscribeEvent
public static void onCheckSpawnEvent(LivingSpawnEvent.CheckSpawn event){
// We have no way of checking if it's a spawner in getCanSpawnHere() so this has to be done here instead
if(!event.isSpawner()){
if(event.getEntityLiving() instanceof EntityLightningWraith && !event.isSpawner()){
if(!event.getWorld().isThundering()) event.setResult(Event.Result.DENY);
if(!ArrayUtils.contains(Wizardry.settings.mobSpawnDimensions, event.getWorld().provider.getDimension()))
event.setResult(Event.Result.DENY);