Search in sources :

Example 11 with EnergyIngredient

use of crazypants.enderio.base.integration.jei.energy.EnergyIngredient in project EnderIO by SleepyTrousers.

the class VatRecipeCategory method setRecipe.

@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull VatRecipeCategory.VatRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients) {
    recipeWrapper.setCurrentLayout(recipeLayout);
    final IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
    final IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
    IGuiIngredientGroup<EnergyIngredient> group = recipeLayout.getIngredientsGroup(EnergyIngredient.class);
    guiItemStacks.init(0, true, 55 - xOff, 11 - yOff);
    guiItemStacks.init(1, true, 104 - xOff, 11 - yOff);
    fluidStacks.init(2, true, inTankBounds.x, inTankBounds.y, inTankBounds.width, inTankBounds.height, 8000, false, null);
    fluidStacks.init(3, false, outTankBounds.x, outTankBounds.y, outTankBounds.width, outTankBounds.height, 8000, false, null);
    group.init(4, true, EnergyIngredientRenderer.INSTANCE, 76, 58, 50, 10, 0, 0);
    guiItemStacks.set(ingredients);
    fluidStacks.set(ingredients);
    group.set(ingredients);
}
Also used : EnergyIngredient(crazypants.enderio.base.integration.jei.energy.EnergyIngredient) IGuiFluidStackGroup(mezz.jei.api.gui.IGuiFluidStackGroup) IGuiItemStackGroup(mezz.jei.api.gui.IGuiItemStackGroup)

Example 12 with EnergyIngredient

use of crazypants.enderio.base.integration.jei.energy.EnergyIngredient 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)

Example 13 with EnergyIngredient

use of crazypants.enderio.base.integration.jei.energy.EnergyIngredient in project EnderIO by SleepyTrousers.

the class CombustionRecipeCategory method setRecipe.

@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull CombustionRecipeWrapper recipeWrapper, @Nonnull IIngredients ingredients) {
    IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
    fluidStacks.init(0, true, 114 - xOff, 21 - yOff, 15, 47, 1000, false, null);
    fluidStacks.init(1, true, 48 - xOff, 21 - yOff, 15, 47, 1000, false, null);
    fluidStacks.set(ingredients);
    IGuiIngredientGroup<EnergyIngredient> group = recipeLayout.getIngredientsGroup(EnergyIngredient.class);
    group.init(2, false, EnergyIngredientRenderer.INSTANCE, 37 - xOff, 9 - yOff, 40, 10, 0, 0);
    group.init(3, false, EnergyIngredientRenderer.INSTANCE, 54 + 47 - xOff, 9 - yOff, 40, 10, 0, 0);
    group.set(ingredients);
}
Also used : EnergyIngredient(crazypants.enderio.base.integration.jei.energy.EnergyIngredient) IGuiFluidStackGroup(mezz.jei.api.gui.IGuiFluidStackGroup)

Aggregations

EnergyIngredient (crazypants.enderio.base.integration.jei.energy.EnergyIngredient)13 IGuiItemStackGroup (mezz.jei.api.gui.IGuiItemStackGroup)10 ItemStack (net.minecraft.item.ItemStack)6 ArrayList (java.util.ArrayList)5 IGuiFluidStackGroup (mezz.jei.api.gui.IGuiFluidStackGroup)4 List (java.util.List)3 RecipeOutput (crazypants.enderio.base.recipe.RecipeOutput)2 NNList (com.enderio.core.common.util.NNList)1 ResultStack (crazypants.enderio.base.recipe.IMachineRecipe.ResultStack)1 CapturedMob (crazypants.enderio.util.CapturedMob)1 IBlockState (net.minecraft.block.state.IBlockState)1 FluidStack (net.minecraftforge.fluids.FluidStack)1