2020-09-09 16:48:43 +02:00
|
|
|
package de.ellpeck.actuallyadditions.common.jei.empowerer;
|
2016-08-03 04:01:47 +02:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2016-11-10 19:50:01 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
2016-08-03 04:01:47 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
|
2020-09-09 16:48:43 +02:00
|
|
|
import de.ellpeck.actuallyadditions.common.blocks.InitBlocks;
|
2020-09-09 16:49:01 +02:00
|
|
|
import de.ellpeck.actuallyadditions.booklet.misc.BookletUtils;
|
2020-09-09 16:48:43 +02:00
|
|
|
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;
|
2016-08-03 04:01:47 +02:00
|
|
|
import net.minecraft.item.ItemStack;
|
2016-11-16 20:31:16 +01:00
|
|
|
|
2018-12-11 07:18:31 +01:00
|
|
|
public class EmpowererRecipeWrapper extends RecipeWrapperWithButton {
|
2016-08-03 04:01:47 +02:00
|
|
|
|
|
|
|
public final EmpowererRecipe theRecipe;
|
|
|
|
|
2018-12-11 07:18:31 +01:00
|
|
|
public EmpowererRecipeWrapper(EmpowererRecipe recipe) {
|
2016-08-03 04:01:47 +02:00
|
|
|
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) {
|
2018-06-24 02:44:47 +02:00
|
|
|
List<ItemStack> inputs = new ArrayList<>();
|
2019-02-27 19:53:05 +01:00
|
|
|
for (ItemStack s : this.theRecipe.getInput().getMatchingStacks())
|
2018-06-24 02:44:47 +02:00
|
|
|
inputs.add(s);
|
2019-02-27 19:53:05 +01:00
|
|
|
for (ItemStack s : this.theRecipe.getStandOne().getMatchingStacks())
|
2018-06-24 02:44:47 +02:00
|
|
|
inputs.add(s);
|
2019-02-27 19:53:05 +01:00
|
|
|
for (ItemStack s : this.theRecipe.getStandTwo().getMatchingStacks())
|
2018-06-24 02:44:47 +02:00
|
|
|
inputs.add(s);
|
2019-02-27 19:53:05 +01:00
|
|
|
for (ItemStack s : this.theRecipe.getStandThree().getMatchingStacks())
|
2018-06-24 02:44:47 +02:00
|
|
|
inputs.add(s);
|
2019-02-27 19:53:05 +01:00
|
|
|
for (ItemStack s : this.theRecipe.getStandFour().getMatchingStacks())
|
2018-06-24 02:44:47 +02:00
|
|
|
inputs.add(s);
|
2018-12-11 07:18:31 +01:00
|
|
|
|
|
|
|
ingredients.setInputs(VanillaTypes.ITEM, inputs);
|
|
|
|
ingredients.setOutput(VanillaTypes.ITEM, this.theRecipe.getOutput());
|
2016-08-03 04:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-12-11 07:18:31 +01:00
|
|
|
public int getButtonX() {
|
2016-08-03 04:01:47 +02:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-12-11 07:18:31 +01:00
|
|
|
public int getButtonY() {
|
2016-08-03 04:01:47 +02:00
|
|
|
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));
|
|
|
|
}
|
|
|
|
}
|