// Kubejs scripts for malum related stuff

ServerEvents.recipes(event => {

// End Portal Crafting
event.custom({
  "type": "malum:spirit_infusion",
  "extra_items": [
    {
      "count": 1,
      "item": "minecraft:ender_pearl"
    },
    {
      "count": 1,
      "item": "malum:warp_flux"
    },
    {
      "count": 1,
      "item": "mekanism:ingot_refined_obsidian"
    }
  ],
  "input": {
    "count": 1,
    "item": "minecraft:end_stone"
  },
  "output": {
    "item": "minecraft:end_portal_frame"
  },
  "spirits": [
    {
      "type": "arcane",
      "count": 4
    },
    {
      "type": "eldritch",
      "count": 2
    }
  ]
})

// Spirit Cluster
event.custom({
  "type": "malum:spirit_infusion",
  "extra_items": [
    {
      "count": 1,
      "item": "minecraft:diamond_block"
    },
    {
      "count": 8,
      "item": "projecte:high_covalence_dust"
    },
    {
      "count": 4,
      "item": "malum:chunk_of_brilliance"
    },
    {
      "count": 1,
      "item": "malum:spectral_optic"
    }
  ],
  "input": {
    "count": 1,
    "item": "malum:cthonic_gold"
  },
  "output": {
    "item": "kubejs:spirit_cluster"
  },
  "spirits": [
    {
      "type": "sacred",
      "count": 16
    },
    {
      "type": "wicked",
      "count": 16
    },
    {
      "type": "arcane",
      "count": 16
    },
    {
      "type": "eldritch",
      "count": 16
    },
    {
      "type": "aerial",
      "count": 16
    },
    {
      "type": "aqueous",
      "count": 16
    },
    {
      "type": "earthen",
      "count": 16
    },
    {
      "type": "infernal",
      "count": 16
    }
  ]
})

// Spirit chunk processing
event.recipes.thermal.pulverizer(['4x kubejs:spirit_chunk_a', '4x kubejs:spirit_chunk_b'], 'kubejs:spirit_cluster').energy(12000)

event.recipes.thermal.centrifuge(['malum:earthen_spirit', 'malum:infernal_spirit', 'malum:sacred_spirit', 'malum:arcane_spirit'], 'kubejs:spirit_chunk_a').energy(9600)
event.recipes.thermal.centrifuge(['malum:aqueous_spirit', 'malum:aerial_spirit', 'malum:eldritch_spirit', 'malum:wicked_spirit'], 'kubejs:spirit_chunk_b').energy(9600)

})

ServerEvents.tags('item', event => {

// Remove runewood logs from logs_that_burn tag so arcane charcoal is obtainable
event.remove('minecraft:logs_that_burn', '#malum:runewood_logs')

})