onEvent("recipes", (event) => {

event.remove({ output: 'mysticalagriculture:prosperity_seed_base' })
event.custom(
  {
  "type": "astralsorcery:altar",
  "altar_type": 3,
  "duration": 100,
  "starlight": 200,
  "pattern": [
    "AABAA",
    "ABDBA",
    "BEFEB",
    "ABCBA",
    "AABAA"
  ],
  "key": {
    "A": {
      "item": 'mysticalagradditions:insanium_essence'
    },
    "B": {
      "item": 'mysticalagriculture:prosperity_shard'
    },
    "C": {
      "item": 'bloodmagic:etherealslate'
    },
    "D": {
      "item": 'astralsorcery:celestial_crystal'
    },
    "E": {
      "item": 'powah:nitro_crystal_block'
    },
    "F": {
      "item": 'minecraft:wheat_seeds'
    }
  },
  "output": [
    {
      "item": 'mysticalagriculture:prosperity_seed_base',
      "count": 1
    }
  ],
  "effects": [
    "astralsorcery:built_in_effect_constellation_finish",
    "astralsorcery:pillar_sparkle",
    "astralsorcery:luminescence_flare",
    "astralsorcery:built_in_effect_discovery_central_beam",
    "astralsorcery:upgrade_altar",
    "astralsorcery:altar_default_sparkle",
    "astralsorcery:built_in_effect_constellation_lines",
    "astralsorcery:built_in_effect_attunement_sparkle",
    "astralsorcery:built_in_effect_trait_relay_highlight"
  ],
}
)

//Inusion Pillar
event.remove({ output: 'mysticalagriculture:infusion_altar' })
event.shaped('mysticalagriculture:infusion_altar', [
'ABA',
'BCB',
'DDD'
], {
  A: 'powah:capacitor_nitro',
  B: 'mysticalagradditions:insanium_essence',
  C: Item.of('astralsorcery:celestial_crystal').ignoreNBT(),
  D: 'astralsorcery:resonating_gem'
})

//Infusion Pillar
event.remove({ output: 'mysticalagriculture:infusion_pedestal' })
event.shaped('mysticalagriculture:infusion_pedestal', [
' A ',
' B ',
' C '
], {
  A: 'astralsorcery:perk_seal',
  B: 'astralsorcery:colored_lens_spectral',
  C: 'astralsorcery:illuminator',
})

function crystal(item1, item3, item4, output) {
  event.remove({ output: output })
  event.custom(
    {
    "type": "astralsorcery:altar",
    "altar_type": 1,
    "duration": 100,
    "starlight": 1000,
    "pattern": [
      "D___D",
      "_CBC_",
      "_BAB_",
      "_CBC_",
      "D___D"
    ],
    "key": {
      "A": {
        "item": item1
      },
      "B": {
        "item": 'mysticalagriculture:prosperity_shard'
      },
      "C": {
        "item": item3
      },
      "D": {
        "item": item4
      }
    },
    "output": [
      {
        "item": output,
        "count": 1
      }
    ],
    "effects": [
      "astralsorcery:built_in_effect_constellation_finish",
      "astralsorcery:pillar_sparkle",
      "astralsorcery:luminescence_flare",
      "astralsorcery:built_in_effect_discovery_central_beam",
      "astralsorcery:upgrade_altar",
      "astralsorcery:altar_default_sparkle",
      "astralsorcery:built_in_effect_constellation_lines",
      "astralsorcery:built_in_effect_attunement_sparkle",
      "astralsorcery:built_in_effect_trait_relay_highlight"
    ],
  }
  )
}

crystal('mysticalagriculture:inferium_gemstone', 'astralsorcery:starmetal_ingot', 'industrialforegoing:pink_slime', 'matc:inferium_crystal')
crystal('matc:inferium_crystal', 'mysticalagriculture:prudentium_block', 'industrialforegoing:pink_slime_ingot', 'matc:prudentium_crystal')
crystal('matc:prudentium_crystal', 'mysticalagriculture:tertium_block', 'industrialforegoing:mob_imprisonment_tool', 'matc:tertium_crystal')
crystal('matc:tertium_crystal', 'mysticalagriculture:imperium_block', 'create:chromatic_compound', 'matc:imperium_crystal')
crystal('matc:imperium_crystal', 'mysticalagriculture:supremium_block', 'powah:nitro_crystal_block', 'matc:supremium_crystal')
crystal('matc:supremium_crystal', 'mysticalagradditions:insanium_block', 'astralsorcery:celestial_crystal', 'mysticalagriculture:master_infusion_crystal')
})
