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
public class AltarRecipeMaker {
@Nonnull
2015-12-02 19:27:28 -08:00
public static List < AltarRecipeJEI > getRecipes ( ) {
Map < ItemStack , AltarRecipeRegistry . AltarRecipe > altarMap = AltarRecipeRegistry . getRecipes ( ) ;
2015-11-28 23:52:06 -08:00
ArrayList < AltarRecipeJEI > recipes = new ArrayList < AltarRecipeJEI > ( ) ;
2015-12-02 19:27:28 -08:00
for ( Map . Entry < ItemStack , AltarRecipeRegistry . AltarRecipe > itemStackAltarRecipeEntry : altarMap . entrySet ( ) ) {
2015-11-28 23:52:06 -08:00
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.
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 ;
}
}