use of net.minecraft.entity.monster.EntityPigZombie in project ICBM-Classic by BuiltBrokenModding.
the class BlastMutation method doExplode.
@Override
public void doExplode() {
if (!this.world().isRemote) {
AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(position.x() - this.getRadius(), position.y() - this.getRadius(), position.z() - this.getRadius(), position.x() + this.getRadius(), position.y() + this.getRadius(), position.z() + this.getRadius());
List<EntityLiving> entitiesNearby = world().getEntitiesWithinAABB(EntityLiving.class, bounds);
for (EntityLiving entity : entitiesNearby) {
if (entity instanceof EntityPig) {
EntityPigZombie newEntity = new EntityPigZombie(world());
newEntity.preventEntitySpawning = true;
newEntity.setPosition(entity.posX, entity.posY, entity.posZ);
entity.setDead();
} else if (entity instanceof EntityVillager) {
EntityZombie newEntity = new EntityZombie(world());
newEntity.preventEntitySpawning = true;
newEntity.setPosition(entity.posX, entity.posY, entity.posZ);
entity.setDead();
}
}
}
}
use of net.minecraft.entity.monster.EntityPigZombie in project ICBM-Classic by BuiltBrokenModding.
the class PoisonContagion method performEffect.
@Override
public void performEffect(EntityLivingBase entityLiving, int amplifier) {
World world = entityLiving.world;
if (!(entityLiving instanceof EntityZombie) && !(entityLiving instanceof EntityPigZombie)) {
entityLiving.attackEntityFrom(DamageSource.MAGIC, 1);
}
if (entityLiving.world.rand.nextFloat() > 0.8) {
int r = 13;
AxisAlignedBB entitySurroundings = new AxisAlignedBB(entityLiving.posX - r, entityLiving.posY - r, entityLiving.posZ - r, entityLiving.posX + r, entityLiving.posY + r, entityLiving.posZ + r);
List<EntityLivingBase> entities = entityLiving.world.getEntitiesWithinAABB(EntityLivingBase.class, entitySurroundings);
for (EntityLivingBase entity : entities) {
if (entity != null && entity != entityLiving) {
if (entity instanceof EntityPig) {
EntityPigZombie newEntity = new EntityPigZombie(entity.world);
newEntity.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
if (!entity.world.isRemote) {
entity.world.spawnEntity(newEntity);
}
entity.setDead();
} else if (entity instanceof EntityVillager) {
if ((world.getDifficulty() == EnumDifficulty.NORMAL || world.getDifficulty() == EnumDifficulty.HARD)) {
EntityVillager entityvillager = (EntityVillager) entity;
EntityZombieVillager entityzombievillager = new EntityZombieVillager(world);
entityzombievillager.copyLocationAndAnglesFrom(entityvillager);
world.removeEntity(entityvillager);
entityzombievillager.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(entityzombievillager)), null);
entityzombievillager.setProfession(entityvillager.getProfession());
entityzombievillager.setChild(entityvillager.isChild());
entityzombievillager.setNoAI(entityvillager.isAIDisabled());
if (entityvillager.hasCustomName()) {
entityzombievillager.setCustomNameTag(entityvillager.getCustomNameTag());
entityzombievillager.setAlwaysRenderNameTag(entityvillager.getAlwaysRenderNameTag());
}
world.spawnEntity(entityzombievillager);
world.playEvent((EntityPlayer) null, 1026, new BlockPos(entity), 0);
}
entity.setDead();
}
ICBMClassic.contagios_potion.poisonEntity(new Pos(entity), entity);
}
}
}
}
use of net.minecraft.entity.monster.EntityPigZombie in project ICBM-Classic by BuiltBrokenModding.
the class BlastMutation method doExplode.
@Override
public boolean doExplode(int callCount) {
if (!this.world().isRemote) {
AxisAlignedBB bounds = new AxisAlignedBB(location.x() - this.getBlastRadius(), location.y() - this.getBlastRadius(), location.z() - this.getBlastRadius(), location.x() + this.getBlastRadius(), location.y() + this.getBlastRadius(), location.z() + this.getBlastRadius());
List<EntityLiving> entitiesNearby = world().getEntitiesWithinAABB(EntityLiving.class, bounds);
for (EntityLiving entity : entitiesNearby) {
if (entity instanceof EntityPig) {
EntityPigZombie newEntity = new EntityPigZombie(world());
newEntity.preventEntitySpawning = true;
newEntity.setPosition(entity.posX, entity.posY, entity.posZ);
entity.setDead();
world().spawnEntity(newEntity);
} else if (entity instanceof EntityVillager) {
EntityZombieVillager newEntity = new EntityZombieVillager(world());
newEntity.preventEntitySpawning = true;
newEntity.setPosition(entity.posX, entity.posY, entity.posZ);
newEntity.setForgeProfession(((EntityVillager) entity).getProfessionForge());
entity.setDead();
world().spawnEntity(newEntity);
}
}
}
return false;
}
use of net.minecraft.entity.monster.EntityPigZombie in project MineFactoryReloaded by powercrystals.
the class ItemSyringeZombie method inject.
@Override
public boolean inject(World world, EntityLiving entity, ItemStack syringe) {
if (world.rand.nextInt(100) < 5) {
Entity e;
if (entity instanceof EntityPig) {
e = new EntityPigZombie(world);
} else {
e = new EntityZombie(world);
}
e.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
world.spawnEntityInWorld(e);
entity.setDead();
} else {
((EntityAgeable) entity).setGrowingAge(0);
}
return true;
}
use of net.minecraft.entity.monster.EntityPigZombie in project NetherEx by LogicTechCorp.
the class EventHandler method onSetAttackTarget.
@SubscribeEvent
public static void onSetAttackTarget(LivingSetAttackTargetEvent event) {
EntityLivingBase attacker = (EntityLivingBase) event.getEntity();
EntityLivingBase attackee = event.getTarget();
if (attackee instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) attackee;
if (attacker instanceof AbstractSkeleton) {
if (ArmorUtil.isWearingFullArmorSet(player, NetherExMaterials.ARMOR_BONE_WITHERED)) {
((AbstractSkeleton) attacker).setAttackTarget(null);
player.addStat(NetherExAchievements.IN_PLAIN_SIGHT);
}
}
if (attacker instanceof EntityPigZombie) {
player.addStat(NetherExAchievements.UH_OH);
}
if (attacker instanceof EntityMogus) {
player.addStat(NetherExAchievements.CUTE_BUT_DEADLY);
}
}
}
Aggregations