Search in sources :

Example 6 with IFabricatorRecipe

use of forestry.api.recipes.IFabricatorRecipe in project ForestryMC by ForestryMC.

the class FabricatorRecipeWrapper method getIngredients.

@Override
public void getIngredients(IIngredients ingredients) {
    IFabricatorRecipe recipe = getRecipe();
    NonNullList<NonNullList<ItemStack>> itemInputs = recipe.getIngredients();
    List<List<ItemStack>> inputStacks = new ArrayList<>();
    for (List<ItemStack> stacks : itemInputs) {
        List<ItemStack> copy = new ArrayList<>();
        copy.addAll(stacks);
        inputStacks.add(copy);
    }
    ingredients.setInputLists(ItemStack.class, inputStacks);
    ingredients.setInputs(FluidStack.class, Collections.singletonList(getRecipe().getLiquid()));
    ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput());
}
Also used : NonNullList(net.minecraft.util.NonNullList) ArrayList(java.util.ArrayList) List(java.util.List) NonNullList(net.minecraft.util.NonNullList) ArrayList(java.util.ArrayList) IFabricatorRecipe(forestry.api.recipes.IFabricatorRecipe) ItemStack(net.minecraft.item.ItemStack)

Aggregations

IFabricatorRecipe (forestry.api.recipes.IFabricatorRecipe)6 ItemStack (net.minecraft.item.ItemStack)5 FluidStack (net.minecraftforge.fluids.FluidStack)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 NonNullList (net.minecraft.util.NonNullList)2 IErrorLogic (forestry.api.core.IErrorLogic)1 IFabricatorSmeltingRecipe (forestry.api.recipes.IFabricatorSmeltingRecipe)1 IInventoryAdapter (forestry.core.inventory.IInventoryAdapter)1 ICraftingPlan (forestry.core.items.ICraftingPlan)1 ShapedRecipeCustom (forestry.core.recipes.ShapedRecipeCustom)1 Nullable (javax.annotation.Nullable)1 IGuiFluidStackGroup (mezz.jei.api.gui.IGuiFluidStackGroup)1 IGuiItemStackGroup (mezz.jei.api.gui.IGuiItemStackGroup)1 Item (net.minecraft.item.Item)1 Fluid (net.minecraftforge.fluids.Fluid)1