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


Java PotionUtils.appendEffects方法代码示例

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


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

示例1: getCraftingResult

import net.minecraft.potion.PotionUtils; //导入方法依赖的package包/类
/**
 * Returns an Item that is the result of this recipe
 */
public ItemStack getCraftingResult(InventoryCrafting inv)
{
    ItemStack itemstack = inv.getStackInRowAndColumn(1, 1);

    if (itemstack.getItem() != Items.LINGERING_POTION)
    {
        return ItemStack.field_190927_a;
    }
    else
    {
        ItemStack itemstack1 = new ItemStack(Items.TIPPED_ARROW, 8);
        PotionUtils.addPotionToItemStack(itemstack1, PotionUtils.getPotionFromItem(itemstack));
        PotionUtils.appendEffects(itemstack1, PotionUtils.getFullEffectsFromItem(itemstack));
        return itemstack1;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:RecipeTippedArrow.java

示例2: getCraftingResult

import net.minecraft.potion.PotionUtils; //导入方法依赖的package包/类
@Override
public ItemStack getCraftingResult(InventoryCrafting inv)
{
	ItemStack outputStack = ItemStack.EMPTY;
	if (countSlotsNotEmpty(inv) <= 1) return outputStack;

	Collection<PotionEffect> effects = new ArrayList<PotionEffect>();

	for (int i = 0; i < inv.getSizeInventory(); i++)
	{
		ItemStack stack = inv.getStackInSlot(i);
		if (!stack.isEmpty())
		{
			if (outputStack.isEmpty()) outputStack = getOutputStack(stack);
			if (outputStack.isEmpty()) return outputStack;

			effects.addAll(getEffectsFromStack(stack));
		}
	}

	outputStack = PotionUtils.appendEffects(outputStack, effects);
	outputStack.setStackDisplayName(I18n.translateToLocal("item.combined_" + outputStack.getItem().getUnlocalizedName().substring(5) + ".name"));

	return outputStack;
}
 
开发者ID:crazysnailboy,项目名称:CombinedPotions,代码行数:26,代码来源:RecipeCombinedPotions2.java

示例3: getCraftingResult

import net.minecraft.potion.PotionUtils; //导入方法依赖的package包/类
/**
 * Returns an Item that is the result of this recipe
 */
@Nullable
public ItemStack getCraftingResult(InventoryCrafting inv)
{
    ItemStack itemstack = inv.getStackInRowAndColumn(1, 1);

    if (itemstack != null && itemstack.getItem() == Items.LINGERING_POTION)
    {
        ItemStack itemstack1 = new ItemStack(Items.TIPPED_ARROW, 8);
        PotionUtils.addPotionToItemStack(itemstack1, PotionUtils.getPotionFromItem(itemstack));
        PotionUtils.appendEffects(itemstack1, PotionUtils.getFullEffectsFromItem(itemstack));
        return itemstack1;
    }
    else
    {
        return null;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:RecipeTippedArrow.java

示例4: getArrowStack

import net.minecraft.potion.PotionUtils; //导入方法依赖的package包/类
protected ItemStack getArrowStack()
{
    ItemStack dart = new ItemStack(ModItems.dart, 1, getType().getMetadata());
    if(potion !=PotionTypes.EMPTY){
    	PotionUtils.addPotionToItemStack(dart, this.potion);
        PotionUtils.appendEffects(dart, this.customPotionEffects);

        if (this.hasColor)
        {
            NBTTagCompound nbttagcompound = dart.getTagCompound();

            if (nbttagcompound == null)
            {
                nbttagcompound = new NBTTagCompound();
                dart.setTagCompound(nbttagcompound);
            }

            nbttagcompound.setInteger("CustomPotionColor", this.getColor());
        }
    }
    return dart;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:23,代码来源:EntityDart.java

示例5: getCraftingGrid

import net.minecraft.potion.PotionUtils; //导入方法依赖的package包/类
@Override
public NonNullList<ItemStack> getCraftingGrid(IRecipe r)
{
	NonNullList<ItemStack> recipeItems = NonNullList.<ItemStack>create();

	for ( int i = 0 ; i < 9 ; i++ )
	{
		if (i != 4)
		{
			recipeItems.add(new ItemStack(Items.ARROW, 1));
		}
		else
		{
			ItemStack stack = new ItemStack(Items.LINGERING_POTION, 1);
            PotionUtils.addPotionToItemStack(stack, PotionUtils.getPotionFromItem(inputStack));
            PotionUtils.appendEffects(stack, PotionUtils.getFullEffectsFromItem(inputStack));
			recipeItems.add(stack);
		}
	}

	return recipeItems;
}
 
开发者ID:crazysnailboy,项目名称:UncraftingTable,代码行数:23,代码来源:NBTSensitiveRecipeHandlers.java

示例6: getArrowStack

import net.minecraft.potion.PotionUtils; //导入方法依赖的package包/类
protected ItemStack getArrowStack()
{
    if (this.customPotionEffects.isEmpty() && this.potion == PotionTypes.EMPTY)
    {
        return new ItemStack(Items.ARROW);
    }
    else
    {
        ItemStack itemstack = new ItemStack(Items.TIPPED_ARROW);
        PotionUtils.addPotionToItemStack(itemstack, this.potion);
        PotionUtils.appendEffects(itemstack, this.customPotionEffects);
        return itemstack;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:EntityTippedArrow.java

示例7: createPotion

import net.minecraft.potion.PotionUtils; //导入方法依赖的package包/类
public static ItemStack createPotion(ItemStack stack, Collection<PotionEffect> effects) {
	PotionUtils.appendEffects(stack, effects);
	return stack;
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:5,代码来源:BrewUtils.java


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