Java Code Examples for net.minecraft.init.Items.glass_bottle()

The following are Jave code examples for showing how to use glass_bottle() 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: DecompiledMinecraft   File: ItemPotion.java   View Source Code Vote up 5 votes
/**
 * Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using
 * the Item before the action is complete.
 */
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn)
{
    if (!playerIn.capabilities.isCreativeMode)
    {
        --stack.stackSize;
    }

    if (!worldIn.isRemote)
    {
        List<PotionEffect> list = this.getEffects(stack);

        if (list != null)
        {
            for (PotionEffect potioneffect : list)
            {
                playerIn.addPotionEffect(new PotionEffect(potioneffect));
            }
        }
    }

    playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);

    if (!playerIn.capabilities.isCreativeMode)
    {
        if (stack.stackSize <= 0)
        {
            return new ItemStack(Items.glass_bottle);
        }

        playerIn.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle));
    }

    return stack;
}
 
Example 2
Project: DecompiledMinecraft   File: ItemPotion.java   View Source Code Vote up 5 votes
/**
 * Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using
 * the Item before the action is complete.
 */
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn)
{
    if (!playerIn.capabilities.isCreativeMode)
    {
        --stack.stackSize;
    }

    if (!worldIn.isRemote)
    {
        List<PotionEffect> list = this.getEffects(stack);

        if (list != null)
        {
            for (PotionEffect potioneffect : list)
            {
                playerIn.addPotionEffect(new PotionEffect(potioneffect));
            }
        }
    }

    playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);

    if (!playerIn.capabilities.isCreativeMode)
    {
        if (stack.stackSize <= 0)
        {
            return new ItemStack(Items.glass_bottle);
        }

        playerIn.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle));
    }

    return stack;
}
 
Example 3
Project: BaseClient   File: ItemPotion.java   View Source Code Vote up 5 votes
/**
 * Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using
 * the Item before the action is complete.
 */
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn)
{
    if (!playerIn.capabilities.isCreativeMode)
    {
        --stack.stackSize;
    }

    if (!worldIn.isRemote)
    {
        List<PotionEffect> list = this.getEffects(stack);

        if (list != null)
        {
            for (PotionEffect potioneffect : list)
            {
                playerIn.addPotionEffect(new PotionEffect(potioneffect));
            }
        }
    }

    playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);

    if (!playerIn.capabilities.isCreativeMode)
    {
        if (stack.stackSize <= 0)
        {
            return new ItemStack(Items.glass_bottle);
        }

        playerIn.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle));
    }

    return stack;
}
 
Example 4
Project: BaseClient   File: ItemPotion.java   View Source Code Vote up 5 votes
/**
 * Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using
 * the Item before the action is complete.
 */
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn)
{
    if (!playerIn.capabilities.isCreativeMode)
    {
        --stack.stackSize;
    }

    if (!worldIn.isRemote)
    {
        List<PotionEffect> list = this.getEffects(stack);

        if (list != null)
        {
            for (PotionEffect potioneffect : list)
            {
                playerIn.addPotionEffect(new PotionEffect(potioneffect));
            }
        }
    }

    playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);

    if (!playerIn.capabilities.isCreativeMode)
    {
        if (stack.stackSize <= 0)
        {
            return new ItemStack(Items.glass_bottle);
        }

        playerIn.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle));
    }

    return stack;
}
 
Example 5
Project: connor41-etfuturum2   File: TileEntityNewBrewingStand.java   View Source Code Vote up 5 votes
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
	if (slot == 4)
		return stack.getItem() == Items.blaze_powder;
	else if (slot == 3)
		return stack.getItem().isPotionIngredient(stack);
	else
		return stack.getItem() instanceof ItemPotion || stack.getItem() == Items.glass_bottle;
}
 
Example 6
Project: DecompiledMinecraft   File: ContainerBrewingStand.java   View Source Code Vote up 4 votes
public static boolean canHoldPotion(ItemStack stack)
{
    return stack != null && (stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle);
}
 
Example 7
Project: DecompiledMinecraft   File: TileEntityBrewingStand.java   View Source Code Vote up 4 votes
/**
 * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
 */
public boolean isItemValidForSlot(int index, ItemStack stack)
{
    return index == 3 ? stack.getItem().isPotionIngredient(stack) : stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle;
}
 
Example 8
Project: DecompiledMinecraft   File: ContainerBrewingStand.java   View Source Code Vote up 4 votes
public static boolean canHoldPotion(ItemStack stack)
{
    return stack != null && (stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle);
}
 
Example 9
Project: DecompiledMinecraft   File: TileEntityBrewingStand.java   View Source Code Vote up 4 votes
/**
 * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
 */
public boolean isItemValidForSlot(int index, ItemStack stack)
{
    return index == 3 ? stack.getItem().isPotionIngredient(stack) : stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle;
}
 
Example 10
Project: BaseClient   File: ContainerBrewingStand.java   View Source Code Vote up 4 votes
public static boolean canHoldPotion(ItemStack stack)
{
    return stack != null && (stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle);
}
 
Example 11
Project: BaseClient   File: TileEntityBrewingStand.java   View Source Code Vote up 4 votes
/**
 * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
 */
public boolean isItemValidForSlot(int index, ItemStack stack)
{
    return index == 3 ? stack.getItem().isPotionIngredient(stack) : stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle;
}
 
Example 12
Project: BaseClient   File: ContainerBrewingStand.java   View Source Code Vote up 4 votes
public static boolean canHoldPotion(ItemStack stack)
{
    return stack != null && (stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle);
}
 
Example 13
Project: BaseClient   File: TileEntityBrewingStand.java   View Source Code Vote up 4 votes
/**
 * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
 */
public boolean isItemValidForSlot(int index, ItemStack stack)
{
    return index == 3 ? stack.getItem().isPotionIngredient(stack) : stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle;
}
 
Example 14
Project: connor41-etfuturum2   File: ContainerNewBrewingStand.java   View Source Code Vote up 4 votes
public static boolean canHoldPotion(ItemStack stack) {
	return stack != null && (stack.getItem() instanceof ItemPotion || stack.getItem() == Items.glass_bottle);
}