ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/common/jei/empowerer/EmpowererRecipeWrapper.java

56 lines
1.8 KiB
Java
Raw Normal View History

package de.ellpeck.actuallyadditions.common.jei.empowerer;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
import de.ellpeck.actuallyadditions.common.blocks.InitBlocks;
2020-09-09 16:49:01 +02:00
import de.ellpeck.actuallyadditions.booklet.misc.BookletUtils;
import de.ellpeck.actuallyadditions.common.jei.RecipeWrapperWithButton;
2016-10-29 10:47:33 +02:00
import mezz.jei.api.ingredients.IIngredients;
2018-12-11 07:18:31 +01:00
import mezz.jei.api.ingredients.VanillaTypes;
import net.minecraft.item.ItemStack;
2018-12-11 07:18:31 +01:00
public class EmpowererRecipeWrapper extends RecipeWrapperWithButton {
public final EmpowererRecipe theRecipe;
2018-12-11 07:18:31 +01:00
public EmpowererRecipeWrapper(EmpowererRecipe recipe) {
this.theRecipe = recipe;
}
2016-10-29 10:47:33 +02:00
@Override
2018-12-11 07:18:31 +01:00
public void getIngredients(IIngredients ingredients) {
List<ItemStack> inputs = new ArrayList<>();
2019-02-27 19:53:05 +01:00
for (ItemStack s : this.theRecipe.getInput().getMatchingStacks())
inputs.add(s);
2019-02-27 19:53:05 +01:00
for (ItemStack s : this.theRecipe.getStandOne().getMatchingStacks())
inputs.add(s);
2019-02-27 19:53:05 +01:00
for (ItemStack s : this.theRecipe.getStandTwo().getMatchingStacks())
inputs.add(s);
2019-02-27 19:53:05 +01:00
for (ItemStack s : this.theRecipe.getStandThree().getMatchingStacks())
inputs.add(s);
2019-02-27 19:53:05 +01:00
for (ItemStack s : this.theRecipe.getStandFour().getMatchingStacks())
inputs.add(s);
2018-12-11 07:18:31 +01:00
ingredients.setInputs(VanillaTypes.ITEM, inputs);
ingredients.setOutput(VanillaTypes.ITEM, this.theRecipe.getOutput());
}
@Override
2018-12-11 07:18:31 +01:00
public int getButtonX() {
return 2;
}
@Override
2018-12-11 07:18:31 +01:00
public int getButtonY() {
return 2;
}
@Override
2018-12-11 07:18:31 +01:00
public IBookletPage getPage() {
2020-09-09 16:49:01 +02:00
return BookletUtils.findFirstPageForStack(new ItemStack(InitBlocks.blockEmpowerer));
}
}