Search in sources :

Example 6 with RecipeOutput

use of crazypants.enderio.base.recipe.RecipeOutput in project EnderIO by SleepyTrousers.

the class Fermenting method register.

@Override
public void register(@Nonnull String recipeName) {
    if (isValid() && isActive()) {
        NNList<IRecipeInput> inputStacks = new NNList<>();
        int slot = 0;
        for (NNIterator<Inputgroup> itr = inputgroup.fastIterator(); itr.hasNext(); ) {
            for (NNIterator<ItemMultiplier> itr2 = itr.next().getItems().fastIterator(); itr2.hasNext(); ) {
                ItemMultiplier item = itr2.next();
                inputStacks.add(new ThingsRecipeInput(item.getThing(), slot, item.multiplier));
            }
            slot++;
        }
        inputStacks.add(new RecipeInput(inputfluid.getFluidStack(), inputfluid.multiplier));
        RecipeOutput recipeOutput = new RecipeOutput(outputfluid.getFluidStack());
        VatRecipeManager.getInstance().addRecipe(new Recipe(recipeOutput, energy, RecipeBonusType.NONE, inputStacks.toArray(new IRecipeInput[inputStacks.size()])));
    }
}
Also used : IRecipeInput(crazypants.enderio.base.recipe.IRecipeInput) RecipeInput(crazypants.enderio.base.recipe.RecipeInput) IRecipeInput(crazypants.enderio.base.recipe.IRecipeInput) ThingsRecipeInput(crazypants.enderio.base.recipe.ThingsRecipeInput) Recipe(crazypants.enderio.base.recipe.Recipe) NNList(com.enderio.core.common.util.NNList) RecipeOutput(crazypants.enderio.base.recipe.RecipeOutput) ThingsRecipeInput(crazypants.enderio.base.recipe.ThingsRecipeInput)

Example 7 with RecipeOutput

use of crazypants.enderio.base.recipe.RecipeOutput in project EnderIO by SleepyTrousers.

the class Slicing method register.

@Override
public void register(@Nonnull String recipeName) {
    if (isValid() && isActive()) {
        NNList<IRecipeInput> inputStacks = new NNList<>();
        for (NNIterator<Item> itr = inputs.fastIterator(); itr.hasNext(); ) {
            final Item item = itr.next();
            inputStacks.add(new ThingsRecipeInput(item.getThing(), inputStacks.size()));
        }
        RecipeOutput recipeOutput = new RecipeOutput(getOutput().getItemStack());
        SliceAndSpliceRecipeManager.getInstance().addRecipe(new Recipe(recipeOutput, energy, RecipeBonusType.NONE, inputStacks.toArray(new IRecipeInput[inputStacks.size()])));
    }
}
Also used : IRecipeInput(crazypants.enderio.base.recipe.IRecipeInput) Recipe(crazypants.enderio.base.recipe.Recipe) NNList(com.enderio.core.common.util.NNList) RecipeOutput(crazypants.enderio.base.recipe.RecipeOutput) ThingsRecipeInput(crazypants.enderio.base.recipe.ThingsRecipeInput)

Example 8 with RecipeOutput

use of crazypants.enderio.base.recipe.RecipeOutput in project EnderIO by SleepyTrousers.

the class AlloyRecipeManager method addRecipe.

public void addRecipe(@Nonnull NNList<IRecipeInput> input, @Nonnull ItemStack output, int energyCost, float xpChance) {
    RecipeOutput recipeOutput = new RecipeOutput(output, 1, xpChance);
    addRecipe(new Recipe(recipeOutput, energyCost, RecipeBonusType.NONE, input.toArray(new IRecipeInput[input.size()])));
}
Also used : Recipe(crazypants.enderio.base.recipe.Recipe) ManyToOneMachineRecipe(crazypants.enderio.base.recipe.ManyToOneMachineRecipe) RecipeOutput(crazypants.enderio.base.recipe.RecipeOutput)

Example 9 with RecipeOutput

use of crazypants.enderio.base.recipe.RecipeOutput in project EnderIO by SleepyTrousers.

the class SagRecipe method getIngredients.

@Override
public void getIngredients(@Nonnull IIngredients ingredients) {
    List<List<ItemStack>> inputStacks = recipe.getInputStackAlternatives();
    List<EnergyIngredient> energies = new ArrayList<>();
    if (recipe.getBonusType().doChances()) {
        final List<ItemStack> balls = SagRecipe.getBalls();
        inputStacks.add(balls);
        for (ItemStack ball : balls) {
            if (ball != null && Prep.isValid(ball)) {
                energies.add(new EnergyIngredient((int) (recipe.getEnergyRequired() * SagMillRecipeManager.getInstance().getGrindballFromStack(ball).getPowerMultiplier())));
            } else {
                energies.add(new EnergyIngredient(recipe.getEnergyRequired()));
            }
        }
    } else {
        // no balls
        inputStacks.add(Collections.emptyList());
        energies.add(new EnergyIngredient(recipe.getEnergyRequired()));
    }
    ingredients.setInputLists(ItemStack.class, inputStacks);
    ingredients.setInputLists(EnergyIngredient.class, Collections.singletonList(energies));
    List<ItemStack> outputs = new ArrayList<ItemStack>();
    for (RecipeOutput out : recipe.getOutputs()) {
        if (Prep.isValid(out.getOutput())) {
            outputs.add(out.getOutput());
        }
    }
    ingredients.setOutputs(ItemStack.class, outputs);
}
Also used : EnergyIngredient(crazypants.enderio.base.integration.jei.energy.EnergyIngredient) RecipeOutput(crazypants.enderio.base.recipe.RecipeOutput) ArrayList(java.util.ArrayList) NNList(com.enderio.core.common.util.NNList) ArrayList(java.util.ArrayList) List(java.util.List) ItemStack(net.minecraft.item.ItemStack)

Aggregations

RecipeOutput (crazypants.enderio.base.recipe.RecipeOutput)9 Recipe (crazypants.enderio.base.recipe.Recipe)5 NNList (com.enderio.core.common.util.NNList)4 ItemStack (net.minecraft.item.ItemStack)4 IRecipeInput (crazypants.enderio.base.recipe.IRecipeInput)3 ThingsRecipeInput (crazypants.enderio.base.recipe.ThingsRecipeInput)3 ArrayList (java.util.ArrayList)3 EnergyIngredient (crazypants.enderio.base.integration.jei.energy.EnergyIngredient)2 IRecipe (crazypants.enderio.base.recipe.IRecipe)2 RecipeInput (crazypants.enderio.base.recipe.RecipeInput)2 List (java.util.List)2 FluidStack (net.minecraftforge.fluids.FluidStack)2 IMachineRecipe (crazypants.enderio.base.recipe.IMachineRecipe)1 MachineRecipeInput (crazypants.enderio.base.recipe.MachineRecipeInput)1 ManyToOneMachineRecipe (crazypants.enderio.base.recipe.ManyToOneMachineRecipe)1 IGuiItemStackGroup (mezz.jei.api.gui.IGuiItemStackGroup)1