Java Code Examples for net.minecraft.init.Items.BEETROOT

The following are Jave code examples for showing how to use BEETROOT of the net.minecraft.init.Items class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Backmemed   File: EntityVillager.java   View Source Code Vote up 6 votes
/**
 * Returns true if villager has enough items in inventory
 */
private boolean hasEnoughItems(int multiplier)
{
    boolean flag = this.getProfession() == 0;

    for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i)
    {
        ItemStack itemstack = this.villagerInventory.getStackInSlot(i);

        if (!itemstack.func_190926_b())
        {
            if (itemstack.getItem() == Items.BREAD && itemstack.func_190916_E() >= 3 * multiplier || itemstack.getItem() == Items.POTATO && itemstack.func_190916_E() >= 12 * multiplier || itemstack.getItem() == Items.CARROT && itemstack.func_190916_E() >= 12 * multiplier || itemstack.getItem() == Items.BEETROOT && itemstack.func_190916_E() >= 12 * multiplier)
            {
                return true;
            }

            if (flag && itemstack.getItem() == Items.WHEAT && itemstack.func_190916_E() >= 9 * multiplier)
            {
                return true;
            }
        }
    }

    return false;
}
 
Example 2
Project: CustomWorldGen   File: EntityVillager.java   View Source Code Vote up 6 votes
/**
 * Returns true if villager has enough items in inventory
 */
private boolean hasEnoughItems(int multiplier)
{
    boolean flag = this.getProfession() == 0;

    for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i)
    {
        ItemStack itemstack = this.villagerInventory.getStackInSlot(i);

        if (itemstack != null)
        {
            if (itemstack.getItem() == Items.BREAD && itemstack.stackSize >= 3 * multiplier || itemstack.getItem() == Items.POTATO && itemstack.stackSize >= 12 * multiplier || itemstack.getItem() == Items.CARROT && itemstack.stackSize >= 12 * multiplier || itemstack.getItem() == Items.BEETROOT && itemstack.stackSize >= 12 * multiplier)
            {
                return true;
            }

            if (flag && itemstack.getItem() == Items.WHEAT && itemstack.stackSize >= 9 * multiplier)
            {
                return true;
            }
        }
    }

    return false;
}
 
Example 3
Project: BaseFoods   File: BlockCorn.java   View Source Code Vote up 4 votes
protected Item getCrop() {
	 return Items.BEETROOT;
}
 
Example 4
Project: Backmemed   File: EntityVillager.java   View Source Code Vote up 4 votes
private boolean canVillagerPickupItem(Item itemIn)
{
    return itemIn == Items.BREAD || itemIn == Items.POTATO || itemIn == Items.CARROT || itemIn == Items.WHEAT || itemIn == Items.WHEAT_SEEDS || itemIn == Items.BEETROOT || itemIn == Items.BEETROOT_SEEDS;
}
 
Example 5
Project: Backmemed   File: BlockBeetroot.java   View Source Code Vote up 4 votes
protected Item getCrop()
{
    return Items.BEETROOT;
}
 
Example 6
Project: CustomWorldGen   File: EntityVillager.java   View Source Code Vote up 4 votes
private boolean canVillagerPickupItem(Item itemIn)
{
    return itemIn == Items.BREAD || itemIn == Items.POTATO || itemIn == Items.CARROT || itemIn == Items.WHEAT || itemIn == Items.WHEAT_SEEDS || itemIn == Items.BEETROOT || itemIn == Items.BEETROOT_SEEDS;
}
 
Example 7
Project: CustomWorldGen   File: BlockBeetroot.java   View Source Code Vote up 4 votes
protected Item getCrop()
{
    return Items.BEETROOT;
}