Check we're dealing with the type of mob whose class we're in, fixes #274
This commit is contained in:
@@ -392,7 +392,7 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onCheckSpawnEvent(LivingSpawnEvent.CheckSpawn event){
|
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
|
// 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()))
|
if(!ArrayUtils.contains(Wizardry.settings.mobSpawnDimensions, event.getWorld().provider.getDimension()))
|
||||||
event.setResult(Event.Result.DENY);
|
event.setResult(Event.Result.DENY);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onCheckSpawnEvent(LivingSpawnEvent.CheckSpawn event){
|
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
|
// 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()))
|
if(!ArrayUtils.contains(Wizardry.settings.mobSpawnDimensions, event.getWorld().provider.getDimension()))
|
||||||
event.setResult(Event.Result.DENY);
|
event.setResult(Event.Result.DENY);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class EntityLightningWraith extends EntityBlazeMinion {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onCheckSpawnEvent(LivingSpawnEvent.CheckSpawn event){
|
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
|
// 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(!event.getWorld().isThundering()) event.setResult(Event.Result.DENY);
|
||||||
if(!ArrayUtils.contains(Wizardry.settings.mobSpawnDimensions, event.getWorld().provider.getDimension()))
|
if(!ArrayUtils.contains(Wizardry.settings.mobSpawnDimensions, event.getWorld().provider.getDimension()))
|
||||||
event.setResult(Event.Result.DENY);
|
event.setResult(Event.Result.DENY);
|
||||||
|
|||||||
Reference in New Issue
Block a user