//ABOE scripts | All Rights Reserved unless otherwise explicitly stated.
//
//Information.
//This adds IE Garden Cloche recipes for all Mystical Agriculture seeds.
//
// Credit to Quentin765 in the KubeJS Discord for the assistance tracking down the recipe format 
//
//Scripted by predundant.
//Last edited by Peter 18.06.2022 (EU date format) (Initial version)


	//Mystical Agriculture Seeds
	//Tier 1
	let seedsTier1 = ['air', 'earth', 'water', 'fire', 'inferium', 'stone', 'dirt', 'wood', 'ice']
	//Tier 2
	let seedsTier2 = ['nature', 'dye', 'nether', 'coal', 'coral', 'honey', 'pig', 'chicken', 'cow', 'sheep', 'squid', 'fish', 'slime', 'turtle', 'rubber', 'silicon', 'sulfur', 'aluminum', 'copper', 'saltpeter', 'apatite', 'mystical_flower', 'marble', 'limestone', 'basalt', 'panda', 'fox', 'bat', 'cat', 'wolf', 'parrot']
	//Tier 3
	let seedsTier3 = ['iron', 'nether_quartz', 'glowstone', 'redstone', 'obsidian', 'prismarine', 'zombie', 'skeleton', 'creeper', 'spider', 'rabbit', 'tin', 'bronze', 'zinc', 'brass', 'silver', 'lead', 'graphite', 'blizz', 'blitz', 'basalz', 'tinkers_bronze', 'slimesteel', 'pig_iron', 'manasteel', 'steeleaf', 'ironwood', 'ender_biotite', 'aquamarine', 'sky_stone', 'certus_quartz', 'quartz_enriched_iron', 'llama', 'husk', 'zombified_piglin', 'silverfish', 'drowned', 'guardian', 'dolphin', 'stray', 'vex', 'polar_bear', 'horse', 'witch']
	//Tier 4
	let seedsTier4 = ['gold', 'lapis_lazuli', 'end', 'experience', 'blaze', 'ghast', 'enderman', 'steel', 'nickel', 'constantan', 'electrum', 'invar', 'mithril', 'tungsten', 'titanium', 'uranium', 'chrome', 'ruby', 'sapphire', 'signalum', 'lumium', 'hop_graphite', 'cobalt', 'rose_gold', 'elementium', 'osmium', 'fluorite', 'refined_glowstone', 'refined_obsidian', 'knightmetal', 'fiery_ingot', 'starmetal', 'compressed_iron', 'fluix', 'energized_steel', 'blazing_crystal', 'ravager', 'magma_cube', 'pillager', 'piglin', 'endermite', 'shulker', 'villager', 'vindicator', 'phantom', 'mooshroom']
	//Tier 5
	let seedsTier5 = ['diamond', 'emerald', 'netherite', 'wither_skeleton', 'platinum', 'iridium', 'enderium', 'manyullyn', 'queens_slime', 'hepatizon', 'terrasteel', 'rock_crystal', 'draconium', 'yellorium', 'cyanite', 'niotic_crystal', 'spirited_crystal', 'uraninite', 'piglin_brute', 'evoker', 'lithium']



onEvent('recipes', e => {

//set up functions for IE Cloche recipes
  function clocheSeedCompat(seeds, time, soil, resCount) {
      seeds.forEach(seed => {
        e.recipes.immersiveengineering.cloche(Item.of(`mysticalagriculture:${seed}_essence`, resCount), `mysticalagriculture:${seed}_seeds`, Item.of(`mysticalagriculture:${soil}_farmland`), { type: "crop", block: "mysticalagriculture:${seed}_crop" }).time(time).id(`kubejs:immersiveengineering/cloche/${seed}`)
      })
    }
	
  function clocheSeedCompatAgradd(seeds, time, crux, resCount) {
      seeds.forEach(seed => {
        e.recipes.immersiveengineering.cloche(Item.of(`mysticalagriculture:${seed}_essence`, resCount), `mysticalagriculture:${seed}_seeds`, Item.of(`mysticalagradditions:${crux}_crux`), { type: "crop", block: "mysticalagriculture:${seed}_crop" }).time(time).id(`kubejs:immersiveengineering/cloche/${seed}`)
      })
    }

	//Cloche Recipes
	clocheSeedCompat(seedsTier1,1200,'inferium', 2)
	clocheSeedCompat(seedsTier2,1200,'prudentium', 2)
	clocheSeedCompat(seedsTier3,1200,'tertium', 2)	
	clocheSeedCompat(seedsTier4,1200,'imperium', 2)
	clocheSeedCompat(seedsTier5,1200,'supremium', 2)
	
	//Tier 6 Cloche Recipes
	clocheSeedCompatAgradd(['nether_star'],1200,'nether_star', 2)
	clocheSeedCompatAgradd(['dragon_egg'],1200,'dragon_egg', 2)
	clocheSeedCompatAgradd(['awakened_draconium'],1200,'awakened_draconium', 2)
	clocheSeedCompatAgradd(['nitro_crystal'],1200,'nitro_crystal', 2)
})