Package net.minecraft.entity.passive

Examples of net.minecraft.entity.passive.EntitySheep


  }
 
  @Override
  public List<ItemStack> ranch(World world, EntityLiving entity, IInventory rancher)
  {
    EntitySheep s = (EntitySheep)entity;
   
    if(s.getSheared() || s.getGrowingAge() < 0)
    {
      return null;
    }
   
    List<ItemStack> stacks = new LinkedList<ItemStack>();
    stacks.add(new ItemStack(Block.cloth, 1, s.getFleeceColor()));
    s.setSheared(true);
   
    return stacks;
  }
View Full Code Here


   * sheep.
   */
  @Override
  public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer player, EntityLivingBase target) {
    if (target instanceof EntitySheep) {
      final EntitySheep sheep = (EntitySheep) target;
      final int damage = itemStack.getItemDamage();
      final Color color = Color.values()[damage];
      final int i = BlockColored.func_150031_c(color.mcDamage);

      LogHelper.info("Dying sheep " + damage + "/" + color + " = " + i);

      if (!sheep.getSheared() && sheep.getFleeceColor() != i) {
        sheep.setFleeceColor(i);
        --itemStack.stackSize;
      }

      return true;
    } else {
View Full Code Here

        PlayerColor marker = new PlayerColor( id, col, 20 * 30 );
        TickHandler.instance.getPlayerColors().put( id, marker );

        if ( pos.entityHit instanceof EntitySheep )
        {
          EntitySheep sh = (EntitySheep) pos.entityHit;
          sh.setFleeceColor( col.ordinal() );
        }

        pos.entityHit.attackEntityFrom( DamageSource.causePlayerDamage( p ), 0 );
        NetworkHandler.instance.sendToAll( marker.getPacket() );
      }
View Full Code Here

    @Override
    public int testCarts(List<EntityMinecart> carts) {
        for (EntityMinecart cart : carts) {
            if (cart.riddenByEntity instanceof EntitySheep) {
                EntitySheep sheep = (EntitySheep) cart.riddenByEntity;
                ItemStack wool = getFilters().getStackInSlot(0);
                if (!sheep.isChild() && !sheep.getSheared() && (wool == null || sheep.getFleeceColor() == wool.getItemDamage())) {
                    return FULL_POWER;
                }
            }
        }
        return NO_POWER;
View Full Code Here

TOP

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

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.