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


Java PotionTypes.WATER属性代码示例

本文整理汇总了Java中net.minecraft.init.PotionTypes.WATER属性的典型用法代码示例。如果您正苦于以下问题:Java PotionTypes.WATER属性的具体用法?Java PotionTypes.WATER怎么用?Java PotionTypes.WATER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.init.PotionTypes的用法示例。


在下文中一共展示了PotionTypes.WATER属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_190901_a

public ItemStack func_190901_a(EntityPlayer p_190901_1_, ItemStack p_190901_2_)
{
    PotionType potiontype = PotionUtils.getPotionFromItem(p_190901_2_);

    if (potiontype != PotionTypes.WATER && potiontype != PotionTypes.EMPTY)
    {
        this.player.addStat(AchievementList.POTION);
    }

    super.func_190901_a(p_190901_1_, p_190901_2_);
    return p_190901_2_;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:ContainerBrewingStand.java

示例2: onPickupFromSlot

public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack)
{
    if (PotionUtils.getPotionFromItem(stack) != PotionTypes.WATER)
    {
        net.minecraftforge.event.ForgeEventFactory.onPlayerBrewedPotion(playerIn, stack);
        this.player.addStat(AchievementList.POTION);
    }

    super.onPickupFromSlot(playerIn, stack);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:ContainerBrewingStand.java

示例3: getNewPotions

private List<ItemStack> getNewPotions(ArrayList<ItemStack> knownPotions, ArrayList<ItemStack> potionIngredients, ArrayList<DrawableRecipe> recipes) {
    List<ItemStack> newPotions = new ArrayList<ItemStack>();
    for (ItemStack potionInput : knownPotions) {
        for (ItemStack potionIngredient : potionIngredients) {
            ItemStack potionOutput = PotionHelper.doReaction(potionIngredient, potionInput.copy());
            if (potionOutput == null) {
                continue;
            }

            if (potionInput.getItem() == potionOutput.getItem()) {
                PotionType potionOutputType = PotionUtils.getPotionFromItem(potionOutput);
                if (potionOutputType == PotionTypes.WATER)
                {
                    continue;
                }

                PotionType potionInputType = PotionUtils.getPotionFromItem(potionInput);
                int inputId = PotionType.REGISTRY.getIDForObject(potionInputType);
                int outputId = PotionType.REGISTRY.getIDForObject(potionOutputType);
                if (inputId == outputId)
                {
                    continue;
                }
            }

            DrawableRecipeBrewing recipe = new DrawableRecipeBrewing(potionInput, potionIngredient, potionOutput);
            if (!containsRecipe(recipe, recipes)) {
                recipes.add(recipe);
                newPotions.add(potionOutput);
            }
        }
    }
    return newPotions;
}
 
开发者ID:Creysys,项目名称:GuideBook,代码行数:34,代码来源:RecipeHandlerBrewing.java

示例4: onPickupFromSlot

public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack)
{
    if (PotionUtils.getPotionFromItem(stack) != PotionTypes.WATER)
    {
        this.player.addStat(AchievementList.POTION);
    }

    super.onPickupFromSlot(playerIn, stack);
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:9,代码来源:ContainerBrewingStand.java

示例5: onImpact

/**
 * Called when this EntityThrowable hits a block or entity.
 */
protected void onImpact(RayTraceResult result)
{
    if (!this.world.isRemote)
    {
        ItemStack itemstack = this.getPotion();
        PotionType potiontype = PotionUtils.getPotionFromItem(itemstack);
        List<PotionEffect> list = PotionUtils.getEffectsFromStack(itemstack);
        boolean flag = potiontype == PotionTypes.WATER && list.isEmpty();

        if (result.typeOfHit == RayTraceResult.Type.BLOCK && flag)
        {
            BlockPos blockpos = result.getBlockPos().offset(result.sideHit);
            this.extinguishFires(blockpos);

            for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
            {
                this.extinguishFires(blockpos.offset(enumfacing));
            }
        }

        if (flag)
        {
            this.func_190545_n();
        }
        else if (!list.isEmpty())
        {
            if (this.isLingering())
            {
                this.func_190542_a(itemstack, potiontype);
            }
            else
            {
                this.func_190543_a(result, list);
            }
        }

        int i = potiontype.hasInstantEffect() ? 2007 : 2002;
        this.world.playEvent(i, new BlockPos(this), PotionUtils.func_190932_c(itemstack));
        this.setDead();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:44,代码来源:EntityPotion.java

示例6: getPotionTypeFromNBT

/**
 * If no correct potion is found, returns the default one : PotionTypes.water
 */
public static PotionType getPotionTypeFromNBT(@Nullable NBTTagCompound tag)
{
    return tag == null ? PotionTypes.WATER : PotionType.getPotionTypeForName(tag.getString("Potion"));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:7,代码来源:PotionUtils.java


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