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

66 lines
2.1 KiB
Java
Raw Normal View History

/*
2016-10-31 19:05:29 +01:00
* This file ("EmpowererRecipeWrapper.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
2017-01-01 16:23:26 +01:00
* © 2015-2017 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.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.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils;
import de.ellpeck.actuallyadditions.mod.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<>();
2018-12-11 07:18:31 +01:00
for (ItemStack s : theRecipe.getInput().getMatchingStacks())
inputs.add(s);
2018-12-11 07:18:31 +01:00
for (ItemStack s : theRecipe.getStandOne().getMatchingStacks())
inputs.add(s);
2018-12-11 07:18:31 +01:00
for (ItemStack s : theRecipe.getStandTwo().getMatchingStacks())
inputs.add(s);
2018-12-11 07:18:31 +01:00
for (ItemStack s : theRecipe.getStandThree().getMatchingStacks())
inputs.add(s);
2018-12-11 07:18:31 +01:00
for (ItemStack s : 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() {
return BookletUtils.findFirstPageForStack(new ItemStack(InitBlocks.blockEmpowerer));
}
}