本文整理匯總了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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例7: createPotion
import net.minecraft.potion.PotionUtils; //導入方法依賴的package包/類
public static ItemStack createPotion(ItemStack stack, Collection<PotionEffect> effects) {
PotionUtils.appendEffects(stack, effects);
return stack;
}