Java Code Examples for net.minecraft.entity.monster.EntityGhast

The following are top voted examples for showing how to use net.minecraft.entity.monster.EntityGhast. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Bewitchment   File: BlockSaltBarrier.java   View source code 6 votes vote down vote up
@SuppressWarnings("deprecation")
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
	if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)) {
		entityIn.attackEntityFrom(DamageSource.MAGIC, 1);
	}
	if (entityIn instanceof EntityBlaze) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityEnderman) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityGhast) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityVex) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
}
 
Example 2
Project: DecompiledMinecraft   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 3
Project: DecompiledMinecraft   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 4
Project: BaseClient   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 5
Project: BaseClient   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 6
Project: EndermanEvolution   File: EntityFrienderman.java   View source code 6 votes vote down vote up
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) {
	if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) {
		if (p_142018_1_ instanceof EntityFrienderman) {
			EntityFrienderman frienderman = (EntityFrienderman) p_142018_1_;

			if (frienderman.isTamed() && frienderman.getOwner() == p_142018_2_) {
				return false;
			}
		}

		return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame();
	}
	else {
		return false;
	}
}
 
Example 7
Project: Backmemed   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof AbstractHorse) || !((AbstractHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 8
Project: CustomWorldGen   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 9
Project: Possessed   File: GhastHandler.java   View source code 6 votes vote down vote up
@Override
public void onClickAir(PossessivePlayer possessivePlayer, EntityPlayer player) {
    EntityGhast possessing = (EntityGhast) possessivePlayer.getPossessing();
    if (!player.worldObj.isRemote && this.getData(player).getShort("ProjectileCooldown") <= 0) {
        player.worldObj.playEvent(null, 1018, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ), 0);
        float pitchVelocity = MathHelper.cos(player.rotationPitch * 0.017453292F);
        float velocityX = -MathHelper.sin(player.rotationYaw * 0.017453292F) * pitchVelocity;
        float velocityY = -MathHelper.sin(player.rotationPitch * 0.017453292F);
        float velocityZ = MathHelper.cos(player.rotationYaw * 0.017453292F) * pitchVelocity;
        EntityLargeFireball fireball = new EntityLargeFireball(player.worldObj, player, velocityX + player.motionX, velocityY + player.motionY, velocityZ + player.motionZ);
        fireball.posY = player.posY + player.height / 2.0F + 0.5D;
        player.worldObj.spawnEntityInWorld(fireball);
        this.getData(player).setShort("ProjectileCooldown", (short) 20);
        possessing.setAttacking(true);
    }
}
 
Example 10
Project: 4Space-5   File: EntitySlimeling.java   View source code 6 votes vote down vote up
@Override
public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase)
{
    if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast))
    {
        if (par1EntityLivingBase instanceof EntitySlimeling)
        {
            EntitySlimeling slimeling = (EntitySlimeling) par1EntityLivingBase;

            if (slimeling.isTamed() && slimeling.getOwner() == par2EntityLivingBase)
            {
                return false;
            }
        }

        return !(par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase)) && (!(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame());
    }
    else
    {
        return false;
    }
}
 
Example 11
Project: Rival-Rebels-Mod   File: TileEntityReciever.java   View source code 6 votes vote down vote up
private boolean isValidTarget(Entity e)
{
	if (e == null) return false;
	else if (e instanceof EntityPlayer)
	{
		EntityPlayer p = ((EntityPlayer) e);
		if (p.capabilities.isCreativeMode) return false;
		else
		{
			if (kPlayers) return true;
			else if (!kTeam) return false;
			RivalRebelsPlayer rrp = RivalRebels.round.rrplayerlist.getForName(((EntityPlayer) e).getCommandSenderName());
			if (rrp == null) return kTeam;
			if (rrp.rrteam == RivalRebelsTeam.NONE) return !p.getCommandSenderName().equals(username);
			if (rrp.rrteam != team) return kTeam;
			else return false;
		}
	}
	else return (kMobs && (e instanceof EntityRhodes || (e instanceof EntityMob && !(e instanceof EntityAnimal) && !(e instanceof EntityBat) && !(e instanceof EntityVillager) && !(e instanceof EntitySquid)) || e instanceof EntityGhast));
}
 
Example 12
Project: ToroHealth   File: AbstractHealthDisplay.java   View source code 6 votes vote down vote up
protected Relation determineRelation() {
	if (entity instanceof EntityMob) {
		return Relation.FOE;
	} else if (entity instanceof EntitySlime) {
		return Relation.FOE;
	} else if (entity instanceof EntityGhast) {
		return Relation.FOE;
	} else if (entity instanceof EntityAnimal) {
		return Relation.FRIEND;
	} else if (entity instanceof EntitySquid) {
		return Relation.FRIEND;
	} else if (entity instanceof EntityAmbientCreature) {
		return Relation.FRIEND;
	} else {
		return Relation.UNKNOWN;
	}
}
 
Example 13
Project: demomod   File: DemoEntityTameable.java   View source code 6 votes vote down vote up
@Override
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) {
	if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) {
		if (p_142018_1_ instanceof DemoEntityTameable) {
			DemoEntityTameable demoEntityTameable = (DemoEntityTameable) p_142018_1_;

			if (demoEntityTameable.isTamed() && demoEntityTameable.getOwnerEntity() == p_142018_2_) {
				return false;
			}
		}

		return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer
				&& !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_) ? false
						: !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame();
	} else {
		return false;
	}
}
 
Example 14
Project: It-s-About-Time-Minecraft-Mod   File: EntityIatWolf.java   View source code 6 votes vote down vote up
public boolean canTargetCreature(EntityLivingBase targetMob, EntityLivingBase thisMob)
{
    if (!(targetMob instanceof EntityCreeper) && !(targetMob instanceof EntityGhast))
    {
        if (targetMob instanceof EntityIatWolf)
        {
            EntityIatWolf entitywolf = (EntityIatWolf)targetMob;

            if (entitywolf.isTamed() && entitywolf.getOwner() == thisMob)
            {
                return false;
            }
        }

        return targetMob instanceof EntityPlayer && thisMob instanceof EntityPlayer && !((EntityPlayer)thisMob).canAttackPlayer((EntityPlayer)targetMob) ? false : !(targetMob instanceof EntityHorse) || !((EntityHorse)targetMob).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 15
Project: Resilience-Client-Source   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase)
{
    if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast))
    {
        if (par1EntityLivingBase instanceof EntityWolf)
        {
            EntityWolf var3 = (EntityWolf)par1EntityLivingBase;

            if (var3.isTamed() && var3.getOwner() == par2EntityLivingBase)
            {
                return false;
            }
        }

        return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).canAttackPlayer((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 16
Project: Resilience-Client-Source   File: RenderGhast.java   View source code 6 votes vote down vote up
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityGhast par1EntityGhast, float par2)
{
    float var4 = ((float)par1EntityGhast.prevAttackCounter + (float)(par1EntityGhast.attackCounter - par1EntityGhast.prevAttackCounter) * par2) / 20.0F;

    if (var4 < 0.0F)
    {
        var4 = 0.0F;
    }

    var4 = 1.0F / (var4 * var4 * var4 * var4 * var4 * 2.0F + 1.0F);
    float var5 = (8.0F + var4) / 2.0F;
    float var6 = (8.0F + 1.0F / var4) / 2.0F;
    GL11.glScalef(var6, var5, var6);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
 
Example 17
Project: ZeroQuest   File: EntityKortor.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityKortor)
        {
        	EntityKortor entitywolf = (EntityKortor)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 18
Project: ZeroQuest   File: EntityForisZertum.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityForisZertum)
        {
            EntityForisZertum entitywolf = (EntityForisZertum)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 19
Project: ZeroQuest   File: EntityDestroZertum.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityDestroZertum)
        {
            EntityDestroZertum entitywolf = (EntityDestroZertum)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 20
Project: ZeroQuest   File: EntityRedZertum.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityRedZertum)
        {
        	EntityRedZertum entitywolf = (EntityRedZertum)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 21
Project: ZeroQuest   File: EntityJakan.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityJakan)
        {
        	EntityJakan entitywolf = (EntityJakan)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 22
Project: ZeroQuest   File: EntityIceZertum.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityIceZertum)
        {
            EntityIceZertum entitywolf = (EntityIceZertum)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 23
Project: ZeroQuest   File: EntityDarkZertum.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityDarkZertum)
        {
            EntityDarkZertum entitywolf = (EntityDarkZertum)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 24
Project: ZeroQuest   File: BiomeGenDarkLand.java   View source code 6 votes vote down vote up
public BiomeGenDarkLand(int id) {
    super(id);
   	this.waterColorMultiplier = 0x666600;
   	this.theBiomeDecorator.treesPerChunk = 1;
   	this.theBiomeDecorator.grassPerChunk = 1;
   	this.theBiomeDecorator.flowersPerChunk = -999;
    this.theBiomeDecorator.generateLakes = true;
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.clear();
    
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityDarkZertum.class, 100, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 60, 1, 5));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 20, 2, 3));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 20, 1, 2));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityKurr.class, 10, 2, 2));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
}
 
Example 25
Project: ZeroQuest   File: BiomeGenDarkLand.java   View source code 6 votes vote down vote up
public BiomeGenDarkLand(int id) {
    super(id);
   	this.waterColorMultiplier = 0x666600;
   	this.theBiomeDecorator.treesPerChunk = 1;
   	this.theBiomeDecorator.grassPerChunk = 1;
   	this.theBiomeDecorator.flowersPerChunk = -999;
   	this.addFlower(ModBlocks.nileBlackFlower.getDefaultState(), 100);
    this.theBiomeDecorator.generateLakes = true;
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.clear();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 60, 1, 5));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 20, 2, 3));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 20, 1, 2));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
}
 
Example 26
Project: ZeroQuest   File: EntityZertumEntity.java   View source code 6 votes vote down vote up
@Override
public boolean func_142018_a(EntityLivingBase entityToAttack, EntityLivingBase owner) {
	if (TalentHelper.canAttackEntity(this, entityToAttack)) {
		return true;
	}

	if (!(entityToAttack instanceof EntityCreeper) && !(entityToAttack instanceof EntityGhast)) {
		if (entityToAttack instanceof EntityZertumEntity) {
			EntityZertumEntity entityZertum = (EntityZertumEntity) entityToAttack;

			if (entityZertum.isTamed() && entityZertum.getOwner() == owner) {
				return false;
			}
		}

		return entityToAttack instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) entityToAttack)
				? false
				: !(entityToAttack instanceof EntityHorse) || !((EntityHorse) entityToAttack).isTame();
	}
	else {
		return false;
	}
}
 
Example 27
Project: ExpandedRailsMod   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 28
Project: reptiles   File: EntityVaranusBase.java   View source code 6 votes vote down vote up
public boolean shouldAttackEntity(EntityLivingBase entityToAttack, EntityLivingBase entityOwner) {
    if (!(entityToAttack instanceof EntityCreeper) && !(entityToAttack instanceof EntityGhast)) {
        if (entityToAttack instanceof EntityVaranusBase) {
            EntityVaranusBase entityvaranus = (EntityVaranusBase)entityToAttack;

            if (entityvaranus.isTamed() && entityvaranus.getOwner() == entityOwner) {
                return false;
            }
            if (world.getDifficulty() == EnumDifficulty.PEACEFUL) {
                return false;
            }
        }
        return !(entityToAttack instanceof EntityPlayer && entityOwner instanceof EntityPlayer && !((EntityPlayer) entityOwner).canAttackPlayer((EntityPlayer) entityToAttack)) && (!(entityToAttack instanceof EntityHorse) || !((EntityHorse) entityToAttack).isTame());
    } else {
        return false;
    }
}
 
Example 29
Project: SilentPets   File: EntityPet.java   View source code 6 votes vote down vote up
@Override
public boolean func_142018_a(EntityLivingBase target, EntityLivingBase owner) {

  if (!(target instanceof EntityCreeper) && !(target instanceof EntityGhast)) {
    if (target instanceof EntityTameable) {
      EntityTameable entityTameable = (EntityTameable) target;

      if (entityTameable.isTamed() && entityTameable.getOwner() == owner) {
        return false;
      }
    }

    return target instanceof EntityPlayer && owner instanceof EntityPlayer
        && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target) ? false
            : !(target instanceof EntityHorse) || !((EntityHorse) target).isTame();
  } else {
    return false;
  }
}
 
Example 30
Project: Quantum-Anomalies   File: BiomeHellAnomaly.java   View source code 6 votes vote down vote up
public BiomeHellAnomaly(int id) {
    super(id);
    this.setBiomeName("Hell Anomaly");

    this.rootHeight = -1F;
    this.heightVariation = 3.5F;

    this.setColor(16711680);
    this.setDisableRain();

    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.clear();
    this.spawnableWaterCreatureList.clear();
    this.spawnableCaveCreatureList.clear();
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 50, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
    this.topBlock = Blocks.netherrack;
    this.fillerBlock = Blocks.netherrack;
    this.theBiomeDecorator = new BiomeAnomalyDecorator();
}
 
Example 31
Project: Cauldron   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 32
Project: Cauldron   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 33
Project: ZeldaSwordSkills   File: ZSSItemEvents.java   View source code 6 votes vote down vote up
private static void init() {
	addDrop(EntityCreeper.class, SkillBase.armorBreak);
	addDrop(EntityIronGolem.class, SkillBase.armorBreak);
	addDrop(EntitySilverfish.class, SkillBase.dash);
	addDrop(EntityHorse.class, SkillBase.dash);
	addDrop(EntityEnderman.class, SkillBase.dodge);
	addDrop(EntityKeese.class, SkillBase.dodge);
	addDrop(EntitySpider.class, SkillBase.endingBlow);
	addDrop(EntityCaveSpider.class, SkillBase.leapingBlow);
	addDrop(EntityMagmaCube.class, SkillBase.leapingBlow);
	addDrop(EntityPigZombie.class, SkillBase.parry);
	addDrop(EntityOcelot.class, SkillBase.parry);
	addDrop(EntityOctorok.class, SkillBase.risingCut);
	addDrop(EntityBlaze.class, SkillBase.spinAttack);
	addDrop(EntityDarknut.class, SkillBase.spinAttack);
	addDrop(EntityZombie.class, SkillBase.swordBasic);
	addDrop(EntitySkeleton.class, SkillBase.swordBasic);
	addDrop(EntityGhast.class, SkillBase.swordBeam);
	addDrop(EntityWitch.class, SkillBase.swordBeam);
	addDrop(EntityWizzrobe.class, SkillBase.swordBreak);
}
 
Example 34
Project: RuneCraftery   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase)
{
    if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast))
    {
        if (par1EntityLivingBase instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)par1EntityLivingBase;

            if (entitywolf.isTamed() && entitywolf.func_130012_q() == par2EntityLivingBase)
            {
                return false;
            }
        }

        return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).canAttackPlayer((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 35
Project: RuneCraftery   File: RenderGhast.java   View source code 6 votes vote down vote up
/**
 * Pre-Renders the Ghast.
 */
protected void preRenderGhast(EntityGhast par1EntityGhast, float par2)
{
    float f1 = ((float)par1EntityGhast.prevAttackCounter + (float)(par1EntityGhast.attackCounter - par1EntityGhast.prevAttackCounter) * par2) / 20.0F;

    if (f1 < 0.0F)
    {
        f1 = 0.0F;
    }

    f1 = 1.0F / (f1 * f1 * f1 * f1 * f1 * 2.0F + 1.0F);
    float f2 = (8.0F + f1) / 2.0F;
    float f3 = (8.0F + 1.0F / f1) / 2.0F;
    GL11.glScalef(f3, f2, f3);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
 
Example 36
Project: CountryGamer_PlantsVsZombies   File: EntDec.java   View source code 6 votes vote down vote up
public static boolean entityUndeadCheck(MovingObjectPosition movObjPos) {
	boolean result = false;
	if ((movObjPos.entityHit instanceof EntityZombie)) {
		result = true;
	}
	if ((movObjPos.entityHit instanceof EntitySkeleton)) {
		result = true;
	}
	if ((movObjPos.entityHit instanceof EntityPigZombie)) {
		result = true;
	}
	if ((!(movObjPos.entityHit instanceof EntityBlaze))
			|| ((!(movObjPos.entityHit instanceof EntityWitherSkull)) || ((!(movObjPos.entityHit instanceof EntityWither)) || ((movObjPos.entityHit instanceof EntityGhast)))))
		;
	return result;
}
 
Example 37
Project: BetterNutritionMod   File: EntityWolf.java   View source code 6 votes vote down vote up
public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase)
{
    if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast))
    {
        if (par1EntityLivingBase instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)par1EntityLivingBase;

            if (entitywolf.isTamed() && entitywolf.func_130012_q() == par2EntityLivingBase)
            {
                return false;
            }
        }

        return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).canAttackPlayer((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).isTame();
    }
    else
    {
        return false;
    }
}
 
Example 38
Project: BetterNutritionMod   File: RenderGhast.java   View source code 6 votes vote down vote up
/**
 * Pre-Renders the Ghast.
 */
protected void preRenderGhast(EntityGhast par1EntityGhast, float par2)
{
    float f1 = ((float)par1EntityGhast.prevAttackCounter + (float)(par1EntityGhast.attackCounter - par1EntityGhast.prevAttackCounter) * par2) / 20.0F;

    if (f1 < 0.0F)
    {
        f1 = 0.0F;
    }

    f1 = 1.0F / (f1 * f1 * f1 * f1 * f1 * 2.0F + 1.0F);
    float f2 = (8.0F + f1) / 2.0F;
    float f3 = (8.0F + 1.0F / f1) / 2.0F;
    GL11.glScalef(f3, f2, f3);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
 
Example 39
Project: PneumaticCraft   File: HackableHandler.java   View source code 6 votes vote down vote up
public static void addDefaultEntries(){
    PneumaticRegistry.getInstance().addHackable(Blocks.tnt, HackableTNT.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.mob_spawner, HackableMobSpawner.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.lever, HackableLever.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.stone_button, HackableButton.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.wooden_button, HackableButton.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.wooden_door, HackableDoor.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.tripwire_hook, HackableTripwire.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.dispenser, HackableDispenser.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.dropper, HackableDispenser.class);
    PneumaticRegistry.getInstance().addHackable(Blockss.securityStation, HackableSecurityStation.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.monster_egg, HackableTripwire.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.noteblock, HackableNoteblock.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.jukebox, HackableJukebox.class);

    PneumaticRegistry.getInstance().addHackable(EntityCreeper.class, HackableCreeper.class);
    PneumaticRegistry.getInstance().addHackable(EntityTameable.class, HackableTameable.class);
    PneumaticRegistry.getInstance().addHackable(EntityCow.class, HackableCow.class);
    PneumaticRegistry.getInstance().addHackable(EntityCaveSpider.class, HackableCaveSpider.class);
    PneumaticRegistry.getInstance().addHackable(EntityBlaze.class, HackableBlaze.class);
    PneumaticRegistry.getInstance().addHackable(EntityGhast.class, HackableGhast.class);
    PneumaticRegistry.getInstance().addHackable(EntityWitch.class, HackableWitch.class);
    PneumaticRegistry.getInstance().addHackable(EntityLiving.class, HackableLivingDisarm.class);
    PneumaticRegistry.getInstance().addHackable(EntityEnderman.class, HackableEnderman.class);
    PneumaticRegistry.getInstance().addHackable(EntityBat.class, HackableBat.class);
}
 
Example 40
Project: pnc-repressurized   File: Reflections.java   View source code 5 votes vote down vote up
public static void init() {
    msbl_isActivated = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, "isActivated", "func_98279_f");
    msbl_getEntityId = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, "getEntityId", "func_190895_g");
    
    // access to non-public entity AI's for hacking purposes
    blaze_aiFireballAttack = findEnclosedClass(EntityBlaze.class, "AIFireballAttack", "a");
    ghast_aiFireballAttack = findEnclosedClass(EntityGhast.class, "AIFireballAttack", "c");
}