Search in sources :

Example 6 with EntityPigZombie

use of net.minecraft.entity.monster.EntityPigZombie in project SecurityCraft by Geforce132.

the class TileEntityProtecto method attackEntity.

@Override
public boolean attackEntity(Entity entity) {
    if (entity instanceof EntityLivingBase) {
        if ((entity instanceof EntityPlayer && (getOwner().isOwner((EntityPlayer) entity) || (hasModule(EnumCustomModules.WHITELIST) && ModuleUtils.getPlayersFromModule(worldObj, pos, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) entity).getCommandSenderName().toLowerCase())))) || entity instanceof EntityPigZombie || (entity instanceof EntityCreeper && ((EntityCreeper) entity).getPowered()))
            return false;
        EntityLightningBolt lightning = new EntityLightningBolt(worldObj, entity.posX, entity.posY, entity.posZ);
        worldObj.addWeatherEffect(lightning);
        BlockUtils.setBlockProperty(worldObj, pos, BlockProtecto.ACTIVATED, false);
        return true;
    }
    return false;
}
Also used : EntityCreeper(net.minecraft.entity.monster.EntityCreeper) EntityPigZombie(net.minecraft.entity.monster.EntityPigZombie) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityLightningBolt(net.minecraft.entity.effect.EntityLightningBolt)

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