当前位置: 首页>>代码示例>>Java>>正文


Java Items.glass_bottle方法代码示例

本文整理汇总了Java中net.minecraft.init.Items.glass_bottle方法的典型用法代码示例。如果您正苦于以下问题:Java Items.glass_bottle方法的具体用法?Java Items.glass_bottle怎么用?Java Items.glass_bottle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.init.Items的用法示例。


在下文中一共展示了Items.glass_bottle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onItemUseFinish

import net.minecraft.init.Items; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:39,代码来源:ItemPotion.java

示例2: isItemValidForSlot

import net.minecraft.init.Items; //导入方法依赖的package包/类
@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;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:10,代码来源:TileEntityNewBrewingStand.java

示例3: canHoldPotion

import net.minecraft.init.Items; //导入方法依赖的package包/类
public static boolean canHoldPotion(ItemStack stack)
{
    return stack != null && (stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:ContainerBrewingStand.java

示例4: isItemValidForSlot

import net.minecraft.init.Items; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:TileEntityBrewingStand.java

示例5: canHoldPotion

import net.minecraft.init.Items; //导入方法依赖的package包/类
public static boolean canHoldPotion(ItemStack stack) {
	return stack != null && (stack.getItem() instanceof ItemPotion || stack.getItem() == Items.glass_bottle);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:4,代码来源:ContainerNewBrewingStand.java


注:本文中的net.minecraft.init.Items.glass_bottle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。