本文整理汇总了Java中net.minecraft.potion.PotionHelper.applyIngredient方法的典型用法代码示例。如果您正苦于以下问题:Java PotionHelper.applyIngredient方法的具体用法?Java PotionHelper.applyIngredient怎么用?Java PotionHelper.applyIngredient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.potion.PotionHelper
的用法示例。
在下文中一共展示了PotionHelper.applyIngredient方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: genPotionLevels
import net.minecraft.potion.PotionHelper; //导入方法依赖的package包/类
public static void genPotionLevels() {
XUHelper.resetTimer();
final HashSet<Item> ingredientIDs = new HashSet<Item>();
final List<Integer> potionIDs = new ArrayList<Integer>();
for (final Object anItemRegistry : Item.itemRegistry) {
final Item i = (Item)anItemRegistry;
for (int num = getMaxMeta(i), meta = 0; meta < num; ++meta) {
if (i.isPotionIngredient(new ItemStack(i, 1, meta))) {
ingredientIDs.add(i);
}
}
}
TileEntityGeneratorPotion.powerMap.put(0, 0);
potionIDs.add(0);
for (int j = 0; j < potionIDs.size(); ++j) {
final int potion = potionIDs.get(j);
for (final Item ingredient : ingredientIDs) {
String k = "";
String s = "";
for (int num2 = getMaxMeta(ingredient), meta2 = 0; meta2 < num2 || !k.equals(s); ++meta2) {
if (ingredient.isPotionIngredient(new ItemStack(ingredient, 1, meta2))) {
try {
s = ingredient.getPotionEffect(new ItemStack(ingredient, 1, meta2));
final int c = PotionHelper.applyIngredient(potion, s);
if (!potionIDs.contains(c)) {
potionIDs.add(c);
TileEntityGeneratorPotion.powerMap.put(c, TileEntityGeneratorPotion.powerMap.get(potion) + 1);
}
k = ((s == null) ? "" : s);
}
catch (Exception err) {
throw new RuntimeException("Caught error while applying potion ingredient " + ingredient.toString() + " to " + potion, err);
}
}
}
}
}
XUHelper.printTimer("Potion generation");
}
示例2: getPotionResult
import net.minecraft.potion.PotionHelper; //导入方法依赖的package包/类
/**
* The result of brewing a potion of the specified damage value with an ingredient itemstack.
*/
private int getPotionResult(int meta, ItemStack stack)
{
return stack == null ? meta : (stack.getItem().isPotionIngredient(stack) ? PotionHelper.applyIngredient(meta, stack.getItem().getPotionEffect(stack)) : meta);
}
示例3: applyIngredient
import net.minecraft.potion.PotionHelper; //导入方法依赖的package包/类
private int applyIngredient(int meta, ItemStack stack) {
return stack == null ? meta : stack.getItem().isPotionIngredient(stack) ? PotionHelper.applyIngredient(meta, stack.getItem().getPotionEffect(stack)) : meta;
}
示例4: func_145936_c
import net.minecraft.potion.PotionHelper; //导入方法依赖的package包/类
private int func_145936_c(int p_145936_1_, ItemStack p_145936_2_)
{
return p_145936_2_ == null ? p_145936_1_ : (p_145936_2_.getItem().isPotionIngredient(p_145936_2_) ? PotionHelper.applyIngredient(p_145936_1_, p_145936_2_.getItem().getPotionEffect(p_145936_2_)) : p_145936_1_);
}
示例5: getSecondPotionList
import net.minecraft.potion.PotionHelper; //导入方法依赖的package包/类
private int getSecondPotionList(int itemDamage, ItemStack stack)
{
return stack == null ? itemDamage : (stack.getItem().isPotionIngredient(stack) ? PotionHelper.applyIngredient(itemDamage, stack.getItem().getPotionEffect(stack)) : itemDamage);
}
示例6: getPotionResult
import net.minecraft.potion.PotionHelper; //导入方法依赖的package包/类
/**
* The result of brewing a potion of the specified damage value with an ingredient itemstack.
*/
private int getPotionResult(int par1, ItemStack par2ItemStack)
{
return par2ItemStack == null ? par1 : (Item.itemsList[par2ItemStack.itemID].isPotionIngredient() ? PotionHelper.applyIngredient(par1, Item.itemsList[par2ItemStack.itemID].getPotionEffect()) : par1);
}