use of com.teamwizardry.wizardry.common.item.ItemStaff in project Wizardry by TeamWizardry.
the class RecipePearl method getCraftingResult.
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull InventoryCrafting inv) {
ItemStack pearl = ItemStack.EMPTY;
ItemStack baseItem = ItemStack.EMPTY;
for (int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if (stack.getItem() instanceof ItemRing || stack.getItem() instanceof ItemStaff) {
if (stack.getItemDamage() == 0)
baseItem = stack;
}
if (stack.getItem() instanceof IInfusable)
pearl = stack;
}
ItemStack baseItemCopy = baseItem.copy();
baseItemCopy.setItemDamage(1);
if (pearl.hasTagCompound())
baseItemCopy.setTagCompound(pearl.getTagCompound());
return baseItemCopy;
}
use of com.teamwizardry.wizardry.common.item.ItemStaff in project Wizardry by TeamWizardry.
the class RecipePearl method matches.
@Override
public boolean matches(@Nonnull InventoryCrafting inv, @Nonnull World worldIn) {
boolean foundBaseItem = false;
boolean foundPearl = false;
for (int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if (stack.getItem() instanceof ItemRing || stack.getItem() instanceof ItemStaff) {
if (stack.getItemDamage() == 0)
foundBaseItem = true;
}
if (stack.getItem() instanceof ItemNacrePearl)
foundPearl = true;
}
return foundBaseItem && foundPearl;
}
Aggregations