BloodMagic/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeJEI.java

35 lines
1.4 KiB
Java
Raw Normal View History

package WayofTime.bloodmagic.compat.jei.armourDowngrade;
import WayofTime.bloodmagic.apibutnotreally.recipe.LivingArmourDowngradeRecipe;
import WayofTime.bloodmagic.apibutnotreally.util.helper.ItemHelper.LivingUpgrades;
2018-02-08 05:45:40 +00:00
import WayofTime.bloodmagic.compat.jei.BloodMagicJEIPlugin;
2017-08-16 04:30:48 +00:00
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
2017-01-02 09:18:02 +00:00
import com.google.common.collect.Lists;
2016-12-13 03:56:36 +00:00
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
2017-01-02 09:18:02 +00:00
import java.util.List;
2017-08-16 04:30:48 +00:00
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper {
private LivingArmourDowngradeRecipe recipe;
2017-08-16 04:30:48 +00:00
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe) {
this.recipe = recipe;
}
@Override
2016-12-13 03:56:36 +00:00
public void getIngredients(IIngredients ingredients) {
2018-02-08 05:45:40 +00:00
List<List<ItemStack>> expanded = BloodMagicJEIPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
2017-01-02 09:18:02 +00:00
expanded.add(Lists.newArrayList(recipe.getKey()));
ingredients.setInputLists(ItemStack.class, expanded);
ItemStack upgradeStack = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
LivingUpgrades.setUpgrade(upgradeStack, recipe.getRecipeOutput());
2016-12-13 03:56:36 +00:00
ingredients.setOutput(ItemStack.class, upgradeStack);
}
2017-08-16 03:21:54 +00:00
public LivingArmourDowngradeRecipe getRecipe() {
return recipe;
}
}