//Priority: 100
/**

  █▀▄▀█ █▀█ █▄░█ █░█ █▀▄▀█ █▀▀ █▄░█ ▀█▀ ▄▀█ █░░   █▀▀ ▀▄▀ █▀█ █▀▀ █▀█ █ █▀▀ █▄░█ █▀▀ █▀▀
  █░▀░█ █▄█ █░▀█ █▄█ █░▀░█ ██▄ █░▀█ ░█░ █▀█ █▄▄   ██▄ █░█ █▀▀ ██▄ █▀▄ █ ██▄ █░▀█ █▄▄ ██▄

  ☻/  * @file The Storage Blocks unify script
  /▌  * @copyright KnightDexx's Modded Minecraft World & ModernGamingWorld
  /\

*/
//======= Missing tags for unify =======
ServerEvents.tags('item', event => {

  event.add('forge:storage_blocks/raw_elementium', 'mythicbotany:raw_elementium_block')

  global.blueskies.forEach(metal => {
    event.add(`forge:storage_blocks/raw_${metal}`, `blue_skies:raw_${metal}_block`)
    event.add(`forge:storage_blocks/${metal}`, `blue_skies:${metal}_block`)
  })

  event.add('forge:gems/charoite', '#blue_skies:gems/charoite')
  event.add('forge:gems/aquite', '#blue_skies:gems/aquite')
  event.add('forge:gems/irradium', 'enlightened_end:irradium_bar')

  event.remove('forge:storage_blocks/steel', ['ad_astra:steel_block'])
  event.remove('forge:ingots/steel', ['ad_astra:steel_ingot'])

})

ServerEvents.recipes(event => {

  const rawBlockMetals = [
    'copper',
    'iron',
    'gold',
    'froststeel',
    'cloggrum',
    'elementium',
    'horizonite',
    'ventium',
    'falsite',
    'iridium',
    'zinc',
    'uranium',
    'tin',
    'silver',
    'platinum',
    'osmium',
    'nickel',
    'aluminum',
    'lead'
  ]

  const rawBlockGems = [
    'charoite',
    'aquite'
  ]

  rawBlockMetals.forEach((material) => {
    event.smelting(`#forge:storage_blocks/${material}`, `#forge:storage_blocks/raw_${material}`, 0.7).id(`kubejs:smelting/raw_${material}_to_${material}_block`)
  })

  rawBlockMetals.forEach((material) => {
    event.smelting(`9x #forge:ingots/${material}`, `#forge:storage_blocks/raw_${material}`, 0.7).id(`kubejs:smelting/raw_${material}_to_${material}_ingots`)
  })

  rawBlockMetals.forEach((material) => {
    event.blasting(`#forge:storage_blocks/${material}`, `#forge:storage_blocks/raw_${material}`, 0.7).id(`kubejs:blasting/raw_${material}_to_${material}_block`)
  })

  rawBlockMetals.forEach((material) => {
    event.blasting(`9x #forge:ingots/${material}`, `#forge:storage_blocks/raw_${material}`, 0.7).id(`kubejs:blasting/raw_${material}_to_${material}_ingots`)
  })

  rawBlockGems.forEach((material) => {
    event.smelting(`#forge:storage_blocks/${material}`, `#forge:storage_blocks/raw_${material}`, 0.7).id(`kubejs:smelting/raw_${material}_to_${material}_block_2`)
  })

  rawBlockGems.forEach((material) => {
    event.smelting(`9x #forge:gems/${material}`, `#forge:storage_blocks/raw_${material}`, 0.7).id(`kubejs:smelting/raw_${material}_to_${material}_gems`)
  })

  rawBlockGems.forEach((material) => {
    event.blasting(`#forge:storage_blocks/${material}`, `#forge:storage_blocks/raw_${material}`, 0.7).id(`kubejs:blasting/raw_${material}_to_${material}_block_2`)
  })

  rawBlockGems.forEach((material) => {
    event.blasting(`9x #forge:gems/${material}`, `#forge:storage_blocks/raw_${material}`, 0.7).id(`kubejs:blasting/raw_${material}_to_${material}_gems`)
  })

  //======= Redstone =======
  event.blasting('4x minecraft:redstone', '#forge:storage_blocks/raw_redstone', 0.7).id(`kubejs:blasting/raw_redstone_to_redstone`)
  event.smelting('4x minecraft:redstone', '#forge:storage_blocks/raw_redstone', 0.7).id(`kubejs:smelting/raw_redstone_to_redstone`)

})