Java Code Examples for mezz.jei.api.ingredients.IIngredients#getOutputs()

The following examples show how to use mezz.jei.api.ingredients.IIngredients#getOutputs() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CraftingRecipeCategory.java    From customstuff4 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
    super.setRecipe(recipeLayout, recipeWrapper, ingredients);

    IGuiItemStackGroup stacks = recipeLayout.getItemStacks();

    List<List<ItemStack>> inputItems = ingredients.getInputs(ItemStack.class);
    List<List<ItemStack>> outputItems = ingredients.getOutputs(ItemStack.class);

    initItems(stacks, true, module.rows * module.columns, 0);
    initItems(stacks, false, 1, module.rows * module.columns);

    if (recipeWrapper instanceof IShapedCraftingRecipeWrapper)
    {
        IShapedCraftingRecipeWrapper wrapper = (IShapedCraftingRecipeWrapper) recipeWrapper;
        craftingGridHelper.setInputs(stacks, inputItems, wrapper.getWidth(), wrapper.getHeight());
    } else
    {
        craftingGridHelper.setInputs(stacks, inputItems);
        recipeLayout.setShapeless();
    }

    stacks.set(module.rows * module.columns, outputItems.get(0));
}
 
Example 2
Source File: MachineRecipeCategory.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setRecipe(IRecipeLayout recipeLayout, MachineRecipeWrapper recipeWrapper, IIngredients ingredients)
{
    super.setRecipe(recipeLayout, recipeWrapper, ingredients);

    IGuiItemStackGroup stacks = recipeLayout.getItemStacks();
    IGuiFluidStackGroup fluids = recipeLayout.getFluidStacks();

    List<List<ItemStack>> inputItems = ingredients.getInputs(ItemStack.class);
    List<List<FluidStack>> inputFluids = ingredients.getInputs(FluidStack.class);
    List<List<ItemStack>> outputItems = ingredients.getOutputs(ItemStack.class);
    List<List<FluidStack>> outputFluids = ingredients.getOutputs(FluidStack.class);

    initItems(stacks, true, module.inputSlots, 0);
    initItems(stacks, false, module.outputSlots, module.inputSlots);

    initFluids(fluids, true, module.inputTanks, 0);
    initFluids(fluids, false, module.outputTanks, module.inputTanks.length);

    for (int i = 0; i < inputItems.size(); i++)
    {
        stacks.set(i, inputItems.get(i));
    }

    for (int i = 0; i < outputItems.size(); i++)
    {
        stacks.set(module.inputSlots + i, outputItems.get(i));
    }

    for (int i = 0; i < inputFluids.size(); i++)
    {
        fluids.set(i, inputFluids.get(i));
    }

    for (int i = 0; i < outputFluids.size(); i++)
    {
        fluids.set(module.inputTanks.length + i, outputFluids.get(i));
    }
}