本文整理匯總了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;
}
}
示例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;
}
}
示例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);
}
}
示例4: isItemValid
import net.minecraft.potion.PotionHelper; //導入方法依賴的package包/類
public boolean isItemValid(ItemStack stack)
{
return PotionHelper.isReagent(stack);
}
示例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);
}