// Kubejs-es for blood

ServerEvents.recipes(event => {

// Replace starter blood orb material
event.remove({output: 'bloodmagic:weakbloodorb'})
event.recipes.bloodmagic.altar('bloodmagic:weakbloodorb', 'minecraft:iron_block').upgradeLevel(0).altarSyphon(2000).consumptionRate(5).drainRate(1)

// Alt tau-fruit enriching
event.recipes.bloodmagic.altar('bloodmagic:strong_tau', 'bloodmagic:weak_tau').upgradeLevel(4).altarSyphon(5000).consumptionRate(20).drainRate(20)

// Viscera Juicer recipe
event.recipes.bloodmagic.alchemytable('mbd2:blood_box', ['bloodmagic:divinationsigil', 'bloodmagic:daggerofsacrifice', 'bloodmagic:tauoil', 'bloodmagic:incensealtar', 'bloodmagic:sacrificerune', 'thermal:fluid_cell']).syphon(10000).ticks(200).upgradeLevel(2)

// Heart recipes
event.recipes.bloodmagic.alchemytable('kubejs:monster_heart', ['bloodmagic:reinforcedslate', 'malum:living_flesh', 'minecraft:bone', 'minecraft:gunpowder', 'minecraft:ender_pearl', 'minecraft:fermented_spider_eye']).syphon(20000).ticks(200).upgradeLevel(2)

event.recipes.bloodmagic.soulforge('kubejs:blazing_heart', 'kubejs:monster_heart', 'minecraft:nether_star', '#kubejs:red_matter', 'botania:blaze_block').minimumDrain(1024).drain(1024)

event.recipes.extendedcrafting.combination("kubejs:otherworldly_heart", 'kubejs:blazing_heart',
['kubejs:prismatter', 'minecraft:dragon_egg','minecraft:end_crystal','minecraft:echo_shard', 'bloodmagic:hellforgedparts'], 20000000).powerRate(50000);

// Tau Fruit phytogenic
event.custom({
  "type": "thermal:insolator",
  "ingredient": {
    "item": "bloodmagic:weak_tau"
  },
  "result": [
    {
      "item": "bloodmagic:weak_tau",
      "chance": 2
    },
	{
      "item": "bloodmagic:weak_tau",
      "chance": 0.5
    }
  ],
  "experience": 0.15
})

// Tartaric Crystal Chamber parts
// casing
event.shaped(
  Item.of('8x kubejs:demon_casing'),
  [
    'cac',
    'aba',
    'cac'
  ],
  {
    a: 'bloodmagic:ingot_hellforged',
    b: 'kubejs:demon_blueprint',
	c: 'bloodmagic:infusedslate'
  }
).keepIngredient('kubejs:demon_blueprint')

// port
event.recipes.bloodmagic.array('mbd2:crystal_chamber_port', 'kubejs:demon_casing', 'minecraft:chest')

// controller
event.recipes.bloodmagic.alchemytable('mbd2:crystal_chamber', ['kubejs:demon_casing', 'bloodmagic:demoncrucible', 'bloodmagic:demoncrystallizer', 'bloodmagic:hellforgedparts', 'bloodmagic:defaultcrystal', 'bloodmagic:etherealslate']).syphon(200000).ticks(600).upgradeLevel(5)

// Blood Forge processing
// Casting Hellforged Ingots
event.custom({
	"type": "createdieselgenerators:casting",
  "ingredients": [
    {
      "fluid": "kubejs:molten_hellforged",
      "amount": 90
    }
  ],
  "mold": "createdieselgenerators:bar",
  "results": [
    {
      "item": "bloodmagic:ingot_hellforged",
      "count": 1
    }
  ]
})

// Converting integral parts into hellforged parts
event.custom({
	"type": "create:filling",
  "ingredients": [
    {
      "item": "thermal:upgrade_augment_3"
    },
    {
      "amount": 250,
      "fluid": "kubejs:liquid_transformation",
      "nbt": {}
    }
  ],
  "results": [
    {
      "item": "bloodmagic:hellforgedparts"
    }
  ]
})

// Multiblock comps
event.recipes.bloodmagic.array('mbd2:bloodforge_input_hatch', 'bloodmagic:dungeon_polished', 'minecraft:bucket')
event.recipes.bloodmagic.array('mbd2:bloodforge_input_bus', 'bloodmagic:dungeon_polished', 'minecraft:chest')
event.recipes.bloodmagic.array('mbd2:bloodforge_output_hatch', 'bloodmagic:bloodstonebrick', 'minecraft:bucket')

// controller
event.recipes.bloodmagic.alchemytable('mbd2:blood_forge', ['bloodmagic:dungeon_polished', 'bloodmagic:dungeon_metal', 'bloodmagic:altar', 'bloodmagic:hellforgedparts', 'bloodmagic:life_essence_bucket', 'bloodmagic:etherealslate']).syphon(200000).ticks(600).upgradeLevel(5)

})