Search in sources :

Example 1 with ItemDrinkingHelmet

use of net.mcft.copy.betterstorage.item.ItemDrinkingHelmet in project BetterStorage by copygirl.

the class DrinkingHelmetRecipe method getCraftingResult.

@Override
public ItemStack getCraftingResult(InventoryCrafting crafting) {
    ItemStack drinkingHelmet = null;
    ItemStack[] potions = null;
    for (int i = 0; i < crafting.getSizeInventory(); i++) {
        drinkingHelmet = crafting.getStackInSlot(i);
        if ((drinkingHelmet != null) && (drinkingHelmet.getItem() instanceof ItemDrinkingHelmet)) {
            drinkingHelmet = drinkingHelmet.copy();
            potions = new ItemStack[] { crafting.getStackInSlot(i + 1), crafting.getStackInSlot(i - 1) };
            break;
        }
    }
    ItemDrinkingHelmet.setPotions(drinkingHelmet, potions);
    return drinkingHelmet;
}
Also used : ItemStack(net.minecraft.item.ItemStack) ItemDrinkingHelmet(net.mcft.copy.betterstorage.item.ItemDrinkingHelmet)

Aggregations

ItemDrinkingHelmet (net.mcft.copy.betterstorage.item.ItemDrinkingHelmet)1 ItemStack (net.minecraft.item.ItemStack)1