Java Code Examples for net.minecraft.entity.passive.EntityOcelot

The following are top voted examples for showing how to use net.minecraft.entity.passive.EntityOcelot. 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: pnc-repressurized   File: HackableTameable.java   View source code 6 votes vote down vote up
@Override
public void onHackFinished(Entity entity, EntityPlayer player) {
    EntityTameable tameable = (EntityTameable) entity;
    if (entity.world.isRemote) {
        tameable.handleStatusUpdate((byte) 7);
    } else {
        tameable.getNavigator().clearPath();
        tameable.setAttackTarget(null);
        tameable.setHealth(20.0F);
        tameable.setOwnerId(player.getUniqueID());
        entity.world.setEntityState(tameable, (byte) 7);
        tameable.setTamed(true);

        // TODO: code smell
        // Would be better to have a HackableOcelot subclass, but HackableHandler.getHackableForEntity() isn't
        // set up to prioritise getting an ocelot over a generic tameable.
        if (entity instanceof EntityOcelot) {
            ((EntityOcelot) entity).setTameSkin(1 + entity.getEntityWorld().rand.nextInt(3));
        }
    }
}
 
Example 2
Project: DecompiledMinecraft   File: BiomeGenJungle.java   View source code 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 3
Project: DecompiledMinecraft   File: BiomeGenJungle.java   View source code 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 4
Project: DecompiledMinecraft   File: RenderOcelot.java   View source code 6 votes vote down vote up
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot entity)
{
    switch (entity.getTameSkin())
    {
        case 0:
        default:
            return ocelotTextures;

        case 1:
            return blackOcelotTextures;

        case 2:
            return redOcelotTextures;

        case 3:
            return siameseOcelotTextures;
    }
}
 
Example 5
Project: BaseClient   File: BiomeGenJungle.java   View source code 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 6
Project: BaseClient   File: RenderOcelot.java   View source code 6 votes vote down vote up
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot entity)
{
    switch (entity.getTameSkin())
    {
        case 0:
        default:
            return ocelotTextures;

        case 1:
            return blackOcelotTextures;

        case 2:
            return redOcelotTextures;

        case 3:
            return siameseOcelotTextures;
    }
}
 
Example 7
Project: BaseClient   File: BiomeGenJungle.java   View source code 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 8
Project: BaseClient   File: RenderOcelot.java   View source code 6 votes vote down vote up
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot entity)
{
    switch (entity.getTameSkin())
    {
        case 0:
        default:
            return ocelotTextures;

        case 1:
            return blackOcelotTextures;

        case 2:
            return redOcelotTextures;

        case 3:
            return siameseOcelotTextures;
    }
}
 
Example 9
Project: Backmemed   File: BiomeJungle.java   View source code 6 votes vote down vote up
public BiomeJungle(boolean isEdgeIn, Biome.BiomeProperties properties)
{
    super(properties);
    this.isEdge = isEdgeIn;

    if (isEdgeIn)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!isEdgeIn)
    {
        this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 10
Project: Backmemed   File: RenderOcelot.java   View source code 6 votes vote down vote up
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot entity)
{
    switch (entity.getTameSkin())
    {
        case 0:
        default:
            return OCELOT_TEXTURES;

        case 1:
            return BLACK_OCELOT_TEXTURES;

        case 2:
            return RED_OCELOT_TEXTURES;

        case 3:
            return SIAMESE_OCELOT_TEXTURES;
    }
}
 
Example 11
Project: CustomWorldGen   File: BiomeJungle.java   View source code 6 votes vote down vote up
public BiomeJungle(boolean isEdgeIn, Biome.BiomeProperties properties)
{
    super(properties);
    this.isEdge = isEdgeIn;

    if (isEdgeIn)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!isEdgeIn)
    {
        this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 12
Project: CustomWorldGen   File: RenderOcelot.java   View source code 6 votes vote down vote up
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot entity)
{
    switch (entity.getTameSkin())
    {
        case 0:
        default:
            return OCELOT_TEXTURES;
        case 1:
            return BLACK_OCELOT_TEXTURES;
        case 2:
            return RED_OCELOT_TEXTURES;
        case 3:
            return SIAMESE_OCELOT_TEXTURES;
    }
}
 
Example 13
Project: 4Space-5   File: BlockTier2TreasureChest.java   View source code 6 votes vote down vote up
@SuppressWarnings("rawtypes")
public static boolean isOcelotBlockingChest(World par0World, int par1, int par2, int par3)
{
    final Iterator var4 = par0World.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getBoundingBox(par1, par2 + 1, par3, par1 + 1, par2 + 2, par3 + 1)).iterator();
    EntityOcelot var6;

    do
    {
        if (!var4.hasNext())
        {
            return false;
        }

        final EntityOcelot var5 = (EntityOcelot) var4.next();
        var6 = var5;
    }
    while (!var6.isSitting());

    return true;
}
 
Example 14
Project: 4Space-5   File: BlockTier3TreasureChest.java   View source code 6 votes vote down vote up
@SuppressWarnings("rawtypes")
public static boolean isOcelotBlockingChest(World par0World, int par1, int par2, int par3)
{
    final Iterator var4 = par0World.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getBoundingBox(par1, par2 + 1, par3, par1 + 1, par2 + 2, par3 + 1)).iterator();
    EntityOcelot var6;

    do
    {
        if (!var4.hasNext())
        {
            return false;
        }

        final EntityOcelot var5 = (EntityOcelot) var4.next();
        var6 = var5;
    }
    while (!var6.isSitting());

    return true;
}
 
Example 15
Project: Gravestone-mod-Extended   File: EntityZombieDog.java   View source code 6 votes vote down vote up
public EntityZombieDog(World world, boolean isHusk) {
    super(world);

    this.setMobType(isHusk ? EnumUndeadMobType.HUSK : EnumUndeadMobType.ZOMBIE);

    ((PathNavigateGround) this.getNavigator()).setCanSwim(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1, false));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1));
    this.tasks.addTask(6, new EntityAIWander(this, 1));
    this.tasks.addTask(5, new EntityAIMoveThroughVillage(this, 1, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false));
    if (ExtendedConfig.zombiePetsAttackPets) {
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWolf.class, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityOcelot.class, false));
    }
    this.targetTasks.addTask(4, new EntityAINearestAttackableHorse(this, false));
    if (ExtendedConfig.zombiePetsAttackAnimals) {
        this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntitySheep.class, false));
    }
}
 
Example 16
Project: Gravestone-mod-Extended   File: EntityZombieCat.java   View source code 6 votes vote down vote up
public EntityZombieCat(World world, boolean isHusk) {
    super(world);

    this.setMobType(isHusk ? EnumUndeadMobType.HUSK : EnumUndeadMobType.ZOMBIE);

    ((PathNavigateGround) this.getNavigator()).setCanSwim(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1, false));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1));
    this.tasks.addTask(6, new EntityAIWander(this, 1));
    this.tasks.addTask(5, new EntityAIMoveThroughVillage(this, 1, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false));
    if (ExtendedConfig.zombiePetsAttackPets) {
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWolf.class, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityOcelot.class, false));
    }
    if (ExtendedConfig.zombiePetsAttackAnimals) {
        this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityChicken.class, false));
    }

    this.targetTasks.addTask(4, new EntityAINearestAttackableHorse(this, false));
}
 
Example 17
Project: Gravestone-mod-Extended   File: CorpseHelper.java   View source code 6 votes vote down vote up
public static List<ItemStack> getCorpse(Entity entity, EnumCorpse type) {
    NBTTagCompound nbtTag = new NBTTagCompound();
    switch (type) {
        case VILLAGER:
            VillagerCorpseHelper.setNbt((EntityVillager) entity, nbtTag);
            break;
        case HORSE:
            HorseCorpseHelper.setNbt((AbstractHorse) entity, nbtTag);
            break;
        case DOG:
            DogCorpseHelper.setNbt((EntityWolf) entity, nbtTag);
            break;
        case CAT:
            CatCorpseHelper.setNbt((EntityOcelot) entity, nbtTag);
            break;
    }

    List<ItemStack> corpse = new ArrayList<>();
    ItemStack stack = new ItemStack(GSBlock.CORPSE, 1, type.ordinal());
    stack.setTagCompound(nbtTag);
    corpse.add(stack);
    return corpse;
}
 
Example 18
Project: amunra   File: TileEntityARChest.java   View source code 6 votes vote down vote up
@SuppressWarnings("rawtypes")
public static boolean isOcelotBlockingChest(World par0World, int par1, int par2, int par3)
{
    final Iterator var4 = par0World.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getBoundingBox(par1, par2 + 1, par3, par1 + 1, par2 + 2, par3 + 1)).iterator();
    EntityOcelot var6;

    do
    {
        if (!var4.hasNext())
        {
            return false;
        }

        final EntityOcelot var5 = (EntityOcelot) var4.next();
        var6 = var5;
    }
    while (!var6.isSitting());

    return true;
}
 
Example 19
Project: Resilience-Client-Source   File: BiomeGenJungle.java   View source code 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 20
Project: Resilience-Client-Source   File: RenderOcelot.java   View source code 6 votes vote down vote up
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot par1EntityOcelot)
{
    switch (par1EntityOcelot.getTameSkin())
    {
        case 0:
        default:
            return ocelotTextures;

        case 1:
            return blackOcelotTextures;

        case 2:
            return redOcelotTextures;

        case 3:
            return siameseOcelotTextures;
    }
}
 
Example 21
Project: NightfallMod   File: BlockNFChest.java   View source code 6 votes vote down vote up
private static boolean func_149953_o(World p_149953_0_, int p_149953_1_, int p_149953_2_, int p_149953_3_) {
	Iterator iterator = p_149953_0_.getEntitiesWithinAABB(EntityOcelot.class,
			AxisAlignedBB.getBoundingBox(p_149953_1_, p_149953_2_ + 1, p_149953_3_, p_149953_1_ + 1, p_149953_2_ + 2, p_149953_3_ + 1)).iterator();
	EntityOcelot entityocelot1;

	do {
		if (!iterator.hasNext()) {
			return false;
		}

		EntityOcelot entityocelot = (EntityOcelot) iterator.next();
		entityocelot1 = entityocelot;
	} while (!entityocelot1.isSitting());

	return true;
}
 
Example 22
Project: ExpandedRailsMod   File: RenderOcelot.java   View source code 6 votes vote down vote up
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot entity)
{
    switch (entity.getTameSkin())
    {
        case 0:
        default:
            return OCELOT_TEXTURES;
        case 1:
            return BLACK_OCELOT_TEXTURES;
        case 2:
            return RED_OCELOT_TEXTURES;
        case 3:
            return SIAMESE_OCELOT_TEXTURES;
    }
}
 
Example 23
Project: SecurityCraft   File: BlockFullMineBase.java   View source code 6 votes vote down vote up
/**
  * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
  */
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity){
 	if(par1World.isRemote){
 		return;
 	}else{
 	
 		if(par5Entity instanceof EntityCreeper || par5Entity instanceof EntityOcelot || par5Entity instanceof EntityEnderman || par5Entity instanceof EntityItem){
 			return;
 		}else{
 			this.explode(par1World, par2, par3, par4);
 		}
 		
 	}
 
 	
 }
 
Example 24
Project: SecurityCraft   File: BlockMine.java   View source code 6 votes vote down vote up
/**
  * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
  */
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
 	if(par1World.isRemote){
 		return;
 	}else{
 	
 		if(par5Entity instanceof EntityCreeper || par5Entity instanceof EntityOcelot || par5Entity instanceof EntityEnderman || par5Entity instanceof EntityItem){
 			return;
 		}else{
 			this.explode(par1World, par2, par3, par4);
 		}
 		
 	}
 
 	
}
 
Example 25
Project: NausicaaMod   File: EntityFoxSquirrel.java   View source code 6 votes vote down vote up
/**
    * Returns true if the mob is currently able to mate with the specified mob.
    */
   @Override
public boolean canMateWith(EntityAnimal par1EntityAnimal)
   {
       if (par1EntityAnimal == this)
       {
           return false;
       }
       else if (!this.isTamed())
       {
           return false;
       }
       else if (!(par1EntityAnimal instanceof EntityOcelot))
       {
           return false;
       }
       else
       {
           EntityOcelot entityocelot = (EntityOcelot)par1EntityAnimal;
           return !entityocelot.isTamed() ? false : this.isInLove() && entityocelot.isInLove();
       }
   }
 
Example 26
Project: NausicaaMod   File: EntityFoxSquirrel.java   View source code 6 votes vote down vote up
@Override
public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData)
   {
       par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData);

       if (this.worldObj.rand.nextInt(7) == 0)
       {
           for (int i = 0; i < 2; ++i)
           {
               EntityOcelot entityocelot = new EntityOcelot(this.worldObj);
               entityocelot.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
               entityocelot.setGrowingAge(-24000);
               this.worldObj.spawnEntityInWorld(entityocelot);
           }
       }

       return par1EntityLivingData;
   }
 
Example 27
Project: Cauldron   File: BiomeGenJungle.java   View source code 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 28
Project: Cauldron   File: BiomeGenJungle.java   View source code 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 29
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 30
Project: 4-Space-Legacy   File: SCVenusT3TreasureChest.java   View source code 6 votes vote down vote up
@SuppressWarnings("rawtypes")
public static boolean isOcelotBlockingChest(World par0World, int par1, int par2, int par3)
{
	final Iterator var4 = par0World.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getAABBPool().getAABB(par1, par2 + 1, par3, par1 + 1, par2 + 2, par3 + 1)).iterator();
	EntityOcelot var6;

	do
	{
		if (!var4.hasNext())
		{
			return false;
		}

		final EntityOcelot var5 = (EntityOcelot) var4.next();
		var6 = var5;
	}
	while (!var6.isSitting());

	return true;
}
 
Example 31
Project: MinecraftScripting   File: ScriptEntity.java   View source code 6 votes vote down vote up
public static ScriptEntity createFromNative(Entity entity) {
	if (entity instanceof EntityPlayer)
		return new ScriptPlayer((EntityPlayer)entity);
	
	if (entity instanceof EntityOcelot)
		return new ScriptOcelot((EntityOcelot)entity);
	if (entity instanceof EntityWolf)
		return new ScriptWolf((EntityWolf)entity);
	if (entity instanceof EntityTameable)
		return new ScriptEntityTameable((EntityTameable)entity);
	
	if (entity instanceof EntityPig)
		return new ScriptPig((EntityPig)entity);
	if (entity instanceof EntitySheep)
		return new ScriptSheep((EntitySheep)entity);
	if (entity instanceof EntityVillager)
		return new ScriptVillager((EntityVillager)entity);
	if (entity instanceof EntityAgeable)
		return new ScriptEntityAgeable((EntityAgeable)entity);
	
	if (entity instanceof EntityLivingBase)
		return new ScriptEntityLivingBase((EntityLivingBase)entity);
	return new ScriptEntity(entity);
}
 
Example 32
Project: Soul-Forest   File: EntitySnowCreeper.java   View source code 6 votes vote down vote up
public EntitySnowCreeper(World par1World){
super(par1World);
this.fuseTime = 1;
this.explosionRadius = 50;
this.setCustomNameTag(this.getCommandSenderName());
//this.texture = "/mob/SnowCreeper.png";
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAICreeperSwell(this));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 0.25F, 0.3F));
this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 0.50F, false));
this.tasks.addTask(5, new EntityAIWander(this, 0.2F));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 20, true));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
   }
 
Example 33
Project: DecompiledMinecraft   File: EntityCreeper.java   View source code 5 votes vote down vote up
public EntityCreeper(World worldIn)
{
    super(worldIn);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAICreeperSwell(this));
    this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
    this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, false));
    this.tasks.addTask(5, new EntityAIWander(this, 0.8D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
}
 
Example 34
Project: DecompiledMinecraft   File: BlockChest.java   View source code 5 votes vote down vote up
private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos)
{
    for (Entity entity : worldIn.getEntitiesWithinAABB(EntityOcelot.class, new AxisAlignedBB((double)pos.getX(), (double)(pos.getY() + 1), (double)pos.getZ(), (double)(pos.getX() + 1), (double)(pos.getY() + 2), (double)(pos.getZ() + 1))))
    {
        EntityOcelot entityocelot = (EntityOcelot)entity;

        if (entityocelot.isSitting())
        {
            return true;
        }
    }

    return false;
}
 
Example 35
Project: DecompiledMinecraft   File: EntityCreeper.java   View source code 5 votes vote down vote up
public EntityCreeper(World worldIn)
{
    super(worldIn);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAICreeperSwell(this));
    this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
    this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, false));
    this.tasks.addTask(5, new EntityAIWander(this, 0.8D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
}
 
Example 36
Project: DecompiledMinecraft   File: BlockChest.java   View source code 5 votes vote down vote up
private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos)
{
    for (Entity entity : worldIn.getEntitiesWithinAABB(EntityOcelot.class, new AxisAlignedBB((double)pos.getX(), (double)(pos.getY() + 1), (double)pos.getZ(), (double)(pos.getX() + 1), (double)(pos.getY() + 2), (double)(pos.getZ() + 1))))
    {
        EntityOcelot entityocelot = (EntityOcelot)entity;

        if (entityocelot.isSitting())
        {
            return true;
        }
    }

    return false;
}
 
Example 37
Project: DecompiledMinecraft   File: RenderOcelot.java   View source code 5 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(EntityOcelot entitylivingbaseIn, float partialTickTime)
{
    super.preRenderCallback(entitylivingbaseIn, partialTickTime);

    if (entitylivingbaseIn.isTamed())
    {
        GlStateManager.scale(0.8F, 0.8F, 0.8F);
    }
}
 
Example 38
Project: BaseClient   File: EntityCreeper.java   View source code 5 votes vote down vote up
public EntityCreeper(World worldIn)
{
    super(worldIn);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAICreeperSwell(this));
    this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
    this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, false));
    this.tasks.addTask(5, new EntityAIWander(this, 0.8D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
}
 
Example 39
Project: BaseClient   File: BlockChest.java   View source code 5 votes vote down vote up
private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos) {
	for (Entity entity : worldIn.getEntitiesWithinAABB(EntityOcelot.class,
			new AxisAlignedBB((double) pos.getX(), (double) (pos.getY() + 1), (double) pos.getZ(),
					(double) (pos.getX() + 1), (double) (pos.getY() + 2), (double) (pos.getZ() + 1)))) {
		EntityOcelot entityocelot = (EntityOcelot) entity;

		if (entityocelot.isSitting()) {
			return true;
		}
	}

	return false;
}
 
Example 40
Project: BaseClient   File: RenderOcelot.java   View source code 5 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(EntityOcelot entitylivingbaseIn, float partialTickTime)
{
    super.preRenderCallback(entitylivingbaseIn, partialTickTime);

    if (entitylivingbaseIn.isTamed())
    {
        GlStateManager.scale(0.8F, 0.8F, 0.8F);
    }
}