Search in sources :

Example 1 with ThingsRecipeInput

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

the class Grindingball method register.

@Override
public void register(@Nonnull String recipeName) {
    if (!disabled && valid && active) {
        Log.debug("Registering XML recipe '" + getName() + "'");
        SagMillRecipeManager.getInstance().addBall(new GrindingBall(new ThingsRecipeInput(item.getThing()), grinding, chance, power, durability));
    } else {
        Log.debug("Skipping XML recipe '" + getName() + "' (valid=" + valid + ", active=" + active + ", required=" + required + ", disabled=" + disabled + ")");
    }
}
Also used : GrindingBall(crazypants.enderio.base.recipe.sagmill.GrindingBall) ThingsRecipeInput(crazypants.enderio.base.recipe.ThingsRecipeInput)

Example 2 with ThingsRecipeInput

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

the class Sagmilling method register.

@Override
public void register(@Nonnull String recipeName) {
    if (isValid() && isActive()) {
        ThingsRecipeInput recipeInput = new ThingsRecipeInput(input.getThing());
        NNList<RecipeOutput> recipeOutputs = new NNList<>();
        for (Output output : getOutputs()) {
            if (output instanceof OutputWithChance) {
                recipeOutputs.add(new RecipeOutput(output.getItemStack(), ((OutputWithChance) output).getChance()));
            } else {
                recipeOutputs.add(new RecipeOutput(output.getItemStack(), 1));
            }
        }
        Recipe recipe = new Recipe(recipeInput, energy, bonus, recipeOutputs.toArray(new RecipeOutput[0]));
        SagMillRecipeManager.getInstance().addRecipe(recipe);
    }
}
Also used : Recipe(crazypants.enderio.base.recipe.Recipe) RecipeOutput(crazypants.enderio.base.recipe.RecipeOutput) NNList(com.enderio.core.common.util.NNList) RecipeOutput(crazypants.enderio.base.recipe.RecipeOutput) ThingsRecipeInput(crazypants.enderio.base.recipe.ThingsRecipeInput)

Example 3 with ThingsRecipeInput

use of crazypants.enderio.base.recipe.ThingsRecipeInput 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 4 with ThingsRecipeInput

use of crazypants.enderio.base.recipe.ThingsRecipeInput 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)

Aggregations

ThingsRecipeInput (crazypants.enderio.base.recipe.ThingsRecipeInput)4 NNList (com.enderio.core.common.util.NNList)3 Recipe (crazypants.enderio.base.recipe.Recipe)3 RecipeOutput (crazypants.enderio.base.recipe.RecipeOutput)3 IRecipeInput (crazypants.enderio.base.recipe.IRecipeInput)2 RecipeInput (crazypants.enderio.base.recipe.RecipeInput)1 GrindingBall (crazypants.enderio.base.recipe.sagmill.GrindingBall)1