Search in sources :

Example 1 with StandardAlloyFurnaceRecipe

use of com.bluepowermod.recipe.AlloyFurnaceRegistry.StandardAlloyFurnaceRecipe in project BluePower by Qmunity.

the class AlloyFurnaceHandler method setIngredients.

@Override
public void setIngredients(StandardAlloyFurnaceRecipe recipe, IIngredients ingredients) {
    List<List<ItemStack>> items = recipe.getRequiredItems().stream().map(ingredient -> Arrays.asList(ingredient.getItems())).collect(Collectors.toList());
    for (int i = 0; i < items.size(); i++) {
        for (ItemStack itemStack : items.get(i)) {
            itemStack.setCount(recipe.getRequiredCount().get(i));
        }
    }
    ingredients.setInputLists(VanillaTypes.ITEM, items);
    ingredients.setOutput(VanillaTypes.ITEM, recipe.getResultItem());
}
Also used : Refs(com.bluepowermod.reference.Refs) Arrays(java.util.Arrays) IDrawable(mezz.jei.api.gui.drawable.IDrawable) BPBlocks(com.bluepowermod.init.BPBlocks) IIngredients(mezz.jei.api.ingredients.IIngredients) Items(net.minecraft.item.Items) IGuiHelper(mezz.jei.api.helpers.IGuiHelper) Collectors(java.util.stream.Collectors) IGuiItemStackGroup(mezz.jei.api.gui.ingredient.IGuiItemStackGroup) ItemStack(net.minecraft.item.ItemStack) List(java.util.List) StandardAlloyFurnaceRecipe(com.bluepowermod.recipe.AlloyFurnaceRegistry.StandardAlloyFurnaceRecipe) IRecipeCategory(mezz.jei.api.recipe.category.IRecipeCategory) ResourceLocation(net.minecraft.util.ResourceLocation) IDrawableAnimated(mezz.jei.api.gui.drawable.IDrawableAnimated) VanillaTypes(mezz.jei.api.constants.VanillaTypes) IRecipeLayout(mezz.jei.api.gui.IRecipeLayout) MatrixStack(com.mojang.blaze3d.matrix.MatrixStack) List(java.util.List) ItemStack(net.minecraft.item.ItemStack)

Aggregations

BPBlocks (com.bluepowermod.init.BPBlocks)1 StandardAlloyFurnaceRecipe (com.bluepowermod.recipe.AlloyFurnaceRegistry.StandardAlloyFurnaceRecipe)1 Refs (com.bluepowermod.reference.Refs)1 MatrixStack (com.mojang.blaze3d.matrix.MatrixStack)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 VanillaTypes (mezz.jei.api.constants.VanillaTypes)1 IRecipeLayout (mezz.jei.api.gui.IRecipeLayout)1 IDrawable (mezz.jei.api.gui.drawable.IDrawable)1 IDrawableAnimated (mezz.jei.api.gui.drawable.IDrawableAnimated)1 IGuiItemStackGroup (mezz.jei.api.gui.ingredient.IGuiItemStackGroup)1 IGuiHelper (mezz.jei.api.helpers.IGuiHelper)1 IIngredients (mezz.jei.api.ingredients.IIngredients)1 IRecipeCategory (mezz.jei.api.recipe.category.IRecipeCategory)1 ItemStack (net.minecraft.item.ItemStack)1 Items (net.minecraft.item.Items)1 ResourceLocation (net.minecraft.util.ResourceLocation)1