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

37 lines
1.3 KiB
Java
Raw Normal View History

package WayofTime.bloodmagic.compat.jei.armourDowngrade;
2017-01-02 01:18:02 -08:00
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import com.google.common.collect.Lists;
2016-12-12 19:56:36 -08:00
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe;
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
2017-01-02 01:18:02 -08:00
import java.util.List;
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
{
private LivingArmourDowngradeRecipe recipe;
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe)
{
this.recipe = recipe;
}
@Override
2016-12-12 19:56:36 -08:00
public void getIngredients(IIngredients ingredients) {
2017-01-02 01:18:02 -08:00
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
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-12 19:56:36 -08:00
ingredients.setOutput(ItemStack.class, upgradeStack);
}
2017-08-15 20:21:54 -07:00
public LivingArmourDowngradeRecipe getRecipe() {
return recipe;
}
}