Search in sources :

Example 1 with EntityPigZombie

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();
            }
        }
    }
}
Also used : AxisAlignedBB(net.minecraft.util.AxisAlignedBB) EntityLiving(net.minecraft.entity.EntityLiving) EntityZombie(net.minecraft.entity.monster.EntityZombie) EntityPig(net.minecraft.entity.passive.EntityPig) EntityPigZombie(net.minecraft.entity.monster.EntityPigZombie) EntityVillager(net.minecraft.entity.passive.EntityVillager)

Example 2 with EntityPigZombie

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);
            }
        }
    }
}
Also used : AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) EntityPig(net.minecraft.entity.passive.EntityPig) World(net.minecraft.world.World) EntityZombieVillager(net.minecraft.entity.monster.EntityZombieVillager) EntityZombie(net.minecraft.entity.monster.EntityZombie) Pos(icbm.classic.lib.transform.vector.Pos) BlockPos(net.minecraft.util.math.BlockPos) EntityPigZombie(net.minecraft.entity.monster.EntityPigZombie) EntityVillager(net.minecraft.entity.passive.EntityVillager) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) BlockPos(net.minecraft.util.math.BlockPos)

Example 3 with EntityPigZombie

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;
}
Also used : AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) EntityZombieVillager(net.minecraft.entity.monster.EntityZombieVillager) EntityLiving(net.minecraft.entity.EntityLiving) EntityPig(net.minecraft.entity.passive.EntityPig) EntityPigZombie(net.minecraft.entity.monster.EntityPigZombie) EntityVillager(net.minecraft.entity.passive.EntityVillager)

Example 4 with EntityPigZombie

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;
}
Also used : Entity(net.minecraft.entity.Entity) EntityZombie(net.minecraft.entity.monster.EntityZombie) EntityPig(net.minecraft.entity.passive.EntityPig) EntityPigZombie(net.minecraft.entity.monster.EntityPigZombie) EntityAgeable(net.minecraft.entity.EntityAgeable)

Example 5 with EntityPigZombie

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);
        }
    }
}
Also used : AbstractSkeleton(net.minecraft.entity.monster.AbstractSkeleton) EntityPigZombie(net.minecraft.entity.monster.EntityPigZombie) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityMogus(nex.entity.neutral.EntityMogus) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

EntityPigZombie (net.minecraft.entity.monster.EntityPigZombie)6 EntityPig (net.minecraft.entity.passive.EntityPig)4 EntityLivingBase (net.minecraft.entity.EntityLivingBase)3 EntityZombie (net.minecraft.entity.monster.EntityZombie)3 EntityVillager (net.minecraft.entity.passive.EntityVillager)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)3 EntityLiving (net.minecraft.entity.EntityLiving)2 EntityZombieVillager (net.minecraft.entity.monster.EntityZombieVillager)2 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)2 Pos (icbm.classic.lib.transform.vector.Pos)1 Entity (net.minecraft.entity.Entity)1 EntityAgeable (net.minecraft.entity.EntityAgeable)1 EntityLightningBolt (net.minecraft.entity.effect.EntityLightningBolt)1 AbstractSkeleton (net.minecraft.entity.monster.AbstractSkeleton)1 EntityCreeper (net.minecraft.entity.monster.EntityCreeper)1 AxisAlignedBB (net.minecraft.util.AxisAlignedBB)1 BlockPos (net.minecraft.util.math.BlockPos)1 World (net.minecraft.world.World)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 EntityMogus (nex.entity.neutral.EntityMogus)1