package WayofTime.bloodmagic.compat.jei.alchemyArray; import WayofTime.bloodmagic.api.ItemStackWrapper; import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffect; import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffectCrafting; import WayofTime.bloodmagic.api.registry.AlchemyArrayRecipeRegistry; import com.google.common.collect.BiMap; import net.minecraft.item.ItemStack; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.Map; public class AlchemyArrayCraftingRecipeMaker { @Nonnull public static List getRecipes() { Map, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes(); ArrayList recipes = new ArrayList(); for (Map.Entry, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet()) { List input = itemStackAlchemyArrayRecipeEntry.getValue().getInput(); BiMap catalystMap = itemStackAlchemyArrayRecipeEntry.getValue().catalystMap; for (Map.Entry entry : catalystMap.entrySet()) { ItemStack catalyst = entry.getKey().toStack(); if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectCrafting) { ItemStack output = ((AlchemyArrayEffectCrafting) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).outputStack; AlchemyArrayCraftingRecipeJEI recipe = new AlchemyArrayCraftingRecipeJEI(input, catalyst, output); recipes.add(recipe); } } } return recipes; } }