Search in sources :

Example 1 with IStackHelper

use of mezz.jei.api.recipe.IStackHelper in project Gaspunk by Ladysnake.

the class GrenadeRecipeWrapper method getIngredients.

@Override
public void getIngredients(@Nonnull IIngredients ingredients) {
    ItemStack recipeOutput = recipe.getRecipeOutput();
    IStackHelper stackHelper = jeiHelpers.getStackHelper();
    List<List<ItemStack>> inputLists = stackHelper.expandRecipeItemStackInputs(recipe.getIngredients());
    ingredients.setInputLists(ItemStack.class, inputLists);
    ingredients.setOutput(ItemStack.class, recipeOutput);
}
Also used : List(java.util.List) ItemStack(net.minecraft.item.ItemStack) IStackHelper(mezz.jei.api.recipe.IStackHelper)

Example 2 with IStackHelper

use of mezz.jei.api.recipe.IStackHelper in project HorsePower by GoryMoon.

the class PressRecipeMaker method getPressRecipes.

public static List<PressRecipeWrapper> getPressRecipes(IJeiHelpers helpers) {
    IStackHelper stackHelper = helpers.getStackHelper();
    Collection<PressRecipe> grindingRecipes = HPRecipes.instance().getPressRecipes();
    List<PressRecipeWrapper> recipes = new ArrayList<>();
    for (PressRecipe recipe : grindingRecipes) {
        ItemStack input = recipe.getInput();
        ItemStack output = recipe.getOutput();
        List<ItemStack> inputs = stackHelper.getSubtypes(input);
        PressRecipeWrapper pressRecipeWrapper = new PressRecipeWrapper(inputs, output);
        recipes.add(pressRecipeWrapper);
    }
    return recipes;
}
Also used : ArrayList(java.util.ArrayList) PressRecipe(se.gory_moon.horsepower.recipes.PressRecipe) IStackHelper(mezz.jei.api.recipe.IStackHelper) ItemStack(net.minecraft.item.ItemStack)

Example 3 with IStackHelper

use of mezz.jei.api.recipe.IStackHelper in project Binnie by ForestryMC.

the class PolymeriserRecipeMaker method create.

public static List<PolymeriserRecipeWrapper> create() {
    List<PolymeriserRecipeWrapper> recipes = new ArrayList<>();
    List<ItemStack> inputs = Arrays.asList(new ItemStack(Genetics.items().itemSequencer, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Genetics.items().itemSerum, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Genetics.items().itemSerumArray, 1, OreDictionary.WILDCARD_VALUE));
    IStackHelper stackHelper = GeneticsJeiPlugin.jeiHelpers.getStackHelper();
    for (ItemStack input : inputs) {
        List<ItemStack> subtypes = stackHelper.toItemStackList(input);
        for (ItemStack subtype : subtypes) {
            subtype = subtype.copy();
            subtype.setItemDamage(subtype.getMaxDamage());
            recipes.add(new PolymeriserRecipeWrapper(subtype));
        }
    }
    return recipes;
}
Also used : ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack) IStackHelper(mezz.jei.api.recipe.IStackHelper)

Example 4 with IStackHelper

use of mezz.jei.api.recipe.IStackHelper in project Pearcel-Mod by MiningMark48.

the class GeneratorFuelRecipeMaker method getFuelRecipes.

public static List<GeneratorFuelRecipe> getFuelRecipes(IJeiHelpers helpers) {
    IGuiHelper guiHelper = helpers.getGuiHelper();
    IStackHelper stackHelper = helpers.getStackHelper();
    List<ItemStack> fuelStacks = GeneratorRegistry.getFuels();
    List<GeneratorFuelRecipe> fuelRecipes = new ArrayList<GeneratorFuelRecipe>(fuelStacks.size());
    for (ItemStack fuelStack : fuelStacks) {
        if (fuelStack == null) {
            continue;
        }
        List<ItemStack> fuels = stackHelper.getSubtypes(fuelStack);
        if (fuels.isEmpty()) {
            continue;
        }
        int cooldownTime = getBurnTime(fuels.get(0));
        int rfPerTick = getRFPerTick(fuels.get(0));
        fuelRecipes.add(new GeneratorFuelRecipe(guiHelper, fuels, cooldownTime, rfPerTick));
    }
    return fuelRecipes;
}
Also used : IGuiHelper(mezz.jei.api.IGuiHelper) ArrayList(java.util.ArrayList) IStackHelper(mezz.jei.api.recipe.IStackHelper) ItemStack(net.minecraft.item.ItemStack)

Example 5 with IStackHelper

use of mezz.jei.api.recipe.IStackHelper in project HorsePower by GoryMoon.

the class ShapedChoppingCraftingWrapper method getIngredients.

@Override
public void getIngredients(IIngredients ingredients) {
    IStackHelper stackHelper = HorsePowerPlugin.jeiHelpers.getStackHelper();
    List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.getIngredients());
    ingredients.setInputLists(ItemStack.class, inputs);
    if (!outputs.isEmpty())
        ingredients.setOutputLists(ItemStack.class, outputs);
}
Also used : List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) NonNullList(net.minecraft.util.NonNullList) IStackHelper(mezz.jei.api.recipe.IStackHelper) ItemStack(net.minecraft.item.ItemStack)

Aggregations

IStackHelper (mezz.jei.api.recipe.IStackHelper)9 ItemStack (net.minecraft.item.ItemStack)9 ArrayList (java.util.ArrayList)6 List (java.util.List)4 ImmutableList (com.google.common.collect.ImmutableList)2 NonNullList (net.minecraft.util.NonNullList)2 ModuleItems (binnie.genetics.item.ModuleItems)1 IGuiHelper (mezz.jei.api.IGuiHelper)1 ChoppingBlockRecipe (se.gory_moon.horsepower.recipes.ChoppingBlockRecipe)1 GrindstoneRecipe (se.gory_moon.horsepower.recipes.GrindstoneRecipe)1 PressRecipe (se.gory_moon.horsepower.recipes.PressRecipe)1