Search in sources :

Example 6 with IItemStack

use of minetweaker.api.item.IItemStack in project Minechem by iopleke.

the class InputHelper method getInputs.

public static ArrayList<ItemStack> getInputs(IIngredient input) {
    ArrayList<ItemStack> toAdd = new ArrayList<ItemStack>();
    if (input instanceof IOreDictEntry) {
        for (ItemStack inStack : OreDictionary.getOres(((IOreDictEntry) input).getName())) {
            ItemStack result = inStack.copy();
            result.stackSize = input.getAmount();
            toAdd.add(result);
        }
    } else if (input instanceof IItemStack) {
        toAdd.add(InputHelper.toStack((IItemStack) input));
    }
    return toAdd;
}
Also used : IItemStack(minetweaker.api.item.IItemStack) IOreDictEntry(minetweaker.api.oredict.IOreDictEntry) ArrayList(java.util.ArrayList) IItemStack(minetweaker.api.item.IItemStack) ItemStack(net.minecraft.item.ItemStack)

Example 7 with IItemStack

use of minetweaker.api.item.IItemStack in project Minechem by iopleke.

the class InputHelper method getInput.

public static ItemStack getInput(IIngredient input) {
    if (input == null) {
        return null;
    }
    if (input instanceof IOreDictEntry) {
        ItemStack result = OreDictionary.getOres(((IOreDictEntry) input).getName()).get(0).copy();
        result.stackSize = input.getAmount();
        return result;
    } else if (input instanceof IngredientStack) {
        ItemStack result = toStack(input.getItems().get(0));
        result.stackSize = input.getAmount();
        return result;
    } else if (input instanceof IItemStack) {
        return toStack((IItemStack) input);
    }
    return null;
}
Also used : IItemStack(minetweaker.api.item.IItemStack) IOreDictEntry(minetweaker.api.oredict.IOreDictEntry) IItemStack(minetweaker.api.item.IItemStack) ItemStack(net.minecraft.item.ItemStack) IngredientStack(minetweaker.api.item.IngredientStack)

Aggregations

IItemStack (minetweaker.api.item.IItemStack)7 ItemStack (net.minecraft.item.ItemStack)7 IOreDictEntry (minetweaker.api.oredict.IOreDictEntry)4 ArrayList (java.util.ArrayList)3 IngredientStack (minetweaker.api.item.IngredientStack)3 IStationRecipe (net.mcft.copy.betterstorage.api.crafting.IStationRecipe)2 PotionChemical (minechem.potion.PotionChemical)1 IIngredient (minetweaker.api.item.IIngredient)1 ZenMethod (stanhebben.zenscript.annotations.ZenMethod)1