Package powercrystals.minefactoryreloaded.farmables.ranchables

Source Code of powercrystals.minefactoryreloaded.farmables.ranchables.RanchableSheep

package powercrystals.minefactoryreloaded.farmables.ranchables;

import java.util.LinkedList;
import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import powercrystals.minefactoryreloaded.api.IFactoryRanchable;

public class RanchableSheep implements IFactoryRanchable
{
  @Override
  public Class<?> getRanchableEntity()
  {
    return EntitySheep.class;
  }
 
  @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;
  }
}
TOP

Related Classes of powercrystals.minefactoryreloaded.farmables.ranchables.RanchableSheep

TOP
Copyright © 2018 www.massapi.com. 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.