當前位置: 首頁>>代碼示例>>Java>>正文


Java PotionHelper.isReagent方法代碼示例

本文整理匯總了Java中net.minecraft.potion.PotionHelper.isReagent方法的典型用法代碼示例。如果您正苦於以下問題:Java PotionHelper.isReagent方法的具體用法?Java PotionHelper.isReagent怎麽用?Java PotionHelper.isReagent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.potion.PotionHelper的用法示例。


在下文中一共展示了PotionHelper.isReagent方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: canBrew

import net.minecraft.potion.PotionHelper; //導入方法依賴的package包/類
private boolean canBrew()
{
    ItemStack itemstack = (ItemStack)this.brewingItemStacks.get(3);

    if (itemstack.func_190926_b())
    {
        return false;
    }
    else if (!PotionHelper.isReagent(itemstack))
    {
        return false;
    }
    else
    {
        for (int i = 0; i < 3; ++i)
        {
            ItemStack itemstack1 = (ItemStack)this.brewingItemStacks.get(i);

            if (!itemstack1.func_190926_b() && PotionHelper.hasConversions(itemstack1, itemstack))
            {
                return true;
            }
        }

        return false;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:28,代碼來源:TileEntityBrewingStand.java

示例2: isItemValidForSlot

import net.minecraft.potion.PotionHelper; //導入方法依賴的package包/類
/**
 * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For
 * guis use Slot.isItemValid
 */
public boolean isItemValidForSlot(int index, ItemStack stack)
{
    if (index == 3)
    {
        return PotionHelper.isReagent(stack);
    }
    else
    {
        Item item = stack.getItem();
        return index == 4 ? item == Items.BLAZE_POWDER : (item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE) && this.getStackInSlot(index) == ItemStack.field_190927_a;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:17,代碼來源:TileEntityBrewingStand.java

示例3: canBrew

import net.minecraft.potion.PotionHelper; //導入方法依賴的package包/類
private boolean canBrew()
{
    if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0 && false) // Code moved to net.minecraftforge.common.brewing.VanillaBrewingRecipe
    {
        ItemStack itemstack = this.brewingItemStacks[3];

        if (!PotionHelper.isReagent(itemstack))
        {
            return false;
        }
        else
        {
            for (int i = 0; i < 3; ++i)
            {
                ItemStack itemstack1 = this.brewingItemStacks[i];

                if (itemstack1 != null && PotionHelper.hasConversions(itemstack1, itemstack))
                {
                    return true;
                }
            }

            return false;
        }
    }
    else
    {
        return net.minecraftforge.common.brewing.BrewingRecipeRegistry.canBrew(brewingItemStacks, brewingItemStacks[3], OUTPUT_SLOTS);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:31,代碼來源:TileEntityBrewingStand.java

示例4: isItemValid

import net.minecraft.potion.PotionHelper; //導入方法依賴的package包/類
public boolean isItemValid(ItemStack stack)
{
    return PotionHelper.isReagent(stack);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:5,代碼來源:ContainerBrewingStand.java

示例5: isIngredient

import net.minecraft.potion.PotionHelper; //導入方法依賴的package包/類
/**
 * Code adapted from TileEntityBrewingStand.isItemValidForSlot(int index, ItemStack stack)
 */
@Override
public boolean isIngredient(ItemStack stack)
{
    return PotionHelper.isReagent(stack);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:9,代碼來源:VanillaBrewingRecipe.java


注:本文中的net.minecraft.potion.PotionHelper.isReagent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。