當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。