當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。