本文整理汇总了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;
}