2015-11-28 23:52:06 -08:00
|
|
|
package WayofTime.bloodmagic.compat.jei.altar;
|
|
|
|
|
|
|
|
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
import javax.annotation.Nonnull;
|
2015-12-01 21:14:26 -08:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
2015-11-28 23:52:06 -08:00
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public class AltarRecipeMaker
|
|
|
|
{
|
2015-11-28 23:52:06 -08:00
|
|
|
|
|
|
|
@Nonnull
|
2015-12-30 15:34:40 -05:00
|
|
|
public static List<AltarRecipeJEI> getRecipes()
|
|
|
|
{
|
2015-12-02 19:27:28 -08:00
|
|
|
Map<ItemStack, AltarRecipeRegistry.AltarRecipe> altarMap = AltarRecipeRegistry.getRecipes();
|
2015-11-28 23:52:06 -08:00
|
|
|
|
|
|
|
ArrayList<AltarRecipeJEI> recipes = new ArrayList<AltarRecipeJEI>();
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
for (Map.Entry<ItemStack, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet())
|
|
|
|
{
|
|
|
|
if (itemStackAltarRecipeEntry.getValue().getOutput() != null)
|
|
|
|
{ // Make sure output is not null. If it is, the recipe is for a
|
|
|
|
// filling orb, and we don't want that.
|
2015-11-28 23:52:06 -08:00
|
|
|
ItemStack input = itemStackAltarRecipeEntry.getKey();
|
|
|
|
ItemStack output = itemStackAltarRecipeEntry.getValue().getOutput();
|
|
|
|
int requiredTier = itemStackAltarRecipeEntry.getValue().getMinTier().toInt();
|
|
|
|
int requiredLP = itemStackAltarRecipeEntry.getValue().getSyphon();
|
|
|
|
|
|
|
|
AltarRecipeJEI recipe = new AltarRecipeJEI(input, output, requiredTier, requiredLP);
|
|
|
|
recipes.add(recipe);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return recipes;
|
|
|
|
}
|
|
|
|
}
|