use of net.minecraftforge.liquids.LiquidStack in project MineFactoryReloaded by powercrystals.
the class RanchableCow method ranch.
@Override
public List<ItemStack> ranch(World world, EntityLiving entity, IInventory rancher) {
List<ItemStack> drops = new LinkedList<ItemStack>();
IInventoryManager manager = InventoryManager.create(rancher, ForgeDirection.UP);
int bucketIndex = manager.findItem(new ItemStack(Item.bucketEmpty));
if (bucketIndex >= 0) {
drops.add(new ItemStack(Item.bucketMilk));
rancher.decrStackSize(bucketIndex, 1);
} else {
LiquidStack milk = LiquidDictionary.getLiquid("milk", 1000);
drops.add(new ItemStack(milk.itemID, 1, milk.itemMeta));
}
return drops;
}
use of net.minecraftforge.liquids.LiquidStack in project MineFactoryReloaded by powercrystals.
the class RanchableMooshroom method ranch.
@Override
public List<ItemStack> ranch(World world, EntityLiving entity, IInventory rancher) {
List<ItemStack> drops = new LinkedList<ItemStack>();
IInventoryManager manager = InventoryManager.create(rancher, ForgeDirection.UP);
int bowlIndex = manager.findItem(new ItemStack(Item.bowlEmpty));
if (bowlIndex >= 0) {
drops.add(new ItemStack(Item.bowlSoup));
rancher.decrStackSize(bowlIndex, 1);
}
int bucketIndex = manager.findItem(new ItemStack(Item.bucketEmpty));
if (bucketIndex >= 0) {
drops.add(new ItemStack(Item.bucketMilk));
rancher.setInventorySlotContents(bucketIndex, null);
} else {
LiquidStack soup = LiquidDictionary.getLiquid("mushroomsoup", 1000);
drops.add(new ItemStack(soup.itemID, 1, soup.itemMeta));
}
return drops;
}
Aggregations