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


Java PotionHelper.applyIngredient方法代码示例

本文整理汇总了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");
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:40,代码来源:TileEntityGeneratorPotion.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:TileEntityBrewingStand.java

示例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;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:4,代码来源:TileEntityNewBrewingStand.java

示例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_);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:TileEntityBrewingStand.java

示例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);
}
 
开发者ID:xbony2,项目名称:Nuclear-Control,代码行数:5,代码来源:ItemVanillaMachineCard.java

示例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);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:8,代码来源:TileEntityBrewingStand.java


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