Package net.minecraft.entity.passive

Examples of net.minecraft.entity.passive.EntityAnimal


    {
        //if (event.target == null)
        if (event.target instanceof EntityCow || event.target instanceof EntitySheep)
        {
            ItemStack equipped = event.entityPlayer.getCurrentEquippedItem();
            EntityAnimal creature = (EntityAnimal) event.target;
            if (equipped != null && equipped.getItem() == NContent.plantItem && equipped.getItemDamage() == 0 && creature.getGrowingAge() == 0 && !creature.isInLove())
            {
                EntityPlayer player = event.entityPlayer;
                if (!player.capabilities.isCreativeMode)
                {
                    --equipped.stackSize;

                    if (equipped.stackSize <= 0)
                    {
                        player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
                    }
                }

                creature.func_146082_f(event.entityPlayer);
            }
        }
    }
View Full Code Here


   
    for(Object o : entities)
    {
      if(o instanceof EntityAnimal)
      {
        EntityAnimal a = ((EntityAnimal)o);
       
        List<ItemStack> foodList;
        if(MFRRegistry.getBreederFoods().containsKey(a.getClass()))
        {
          foodList = MFRRegistry.getBreederFoods().get(a.getClass());
        }
        else
        {
          foodList = new ArrayList<ItemStack>();
          foodList.add(new ItemStack(Item.wheat));
        }
        for(ItemStack food : foodList)
        {
          int stackIndex = manager.findItem(food);
          if(stackIndex < 0)
          {
            continue;
          }
         
          if(!a.isInLove() && a.getGrowingAge() == 0)
          {
            a.inLove = 600;
            decrStackSize(stackIndex, 1);
           
            for (int var3 = 0; var3 < 7; ++var3)
            {
              double var4 = a.getRNG().nextGaussian() * 0.02D;
              double var6 = a.getRNG().nextGaussian() * 0.02D;
              double var8 = a.getRNG().nextGaussian() * 0.02D;
              this.worldObj.spawnParticle("heart", a.posX + a.getRNG().nextFloat() * a.width * 2.0F - a.width, a.posY + 0.5D + a.getRNG().nextFloat() * a.height, a.posZ + a.getRNG().nextFloat() * a.width * 2.0F - a.width, var4, var6, var8);
            }
            return true;
          }
        }
      }
View Full Code Here

     */
    private EntityAnimal getNearbyMate() {
        float var1 = 8.0F;
        List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)var1, (double)var1, (double)var1));
        Iterator entity = var2.iterator();
        EntityAnimal target;

        do {
            if(!entity.hasNext()) {
                return null;
            }
View Full Code Here

TOP

Related Classes of net.minecraft.entity.passive.EntityAnimal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.