// priority: 10

ServerEvents.recipes(event => {

    




  altar(100, 5, 5, "stoneopolis:void_chunk", "bloodmagic:blankslate", 0, "bloodmagic:altar/slate")
  altar(1000, 5, 5, "stoneopolis:void_ingot", "bloodmagic:weakbloodorb", 0, "bloodmagic:altar/weakbloodorb")
  altarComplex(1000, 5, 5, "morebuckets:copper_bucket", Item.of('morebuckets:copper_bucket', '{Amount:1000,FluidName:"bloodmagic:life_essence_fluid"}'), 0, "stoneopolis:life_essence_copper")
  altarComplex(1000, 5, 5, "morebuckets:tin_bucket", Item.of('morebuckets:tin_bucket', '{Amount:1000,FluidName:"bloodmagic:life_essence_fluid"}'), 0, "stoneopolis:life_essence_tin")

  altar(100, 5, 5, "strainers:mulch", "stoneopolis:grass_seed", 0, "stoneopolis:grass_seed")


  altar(5000, 5, 5, "minecraft:copper_block", "bloodmagic:apprenticebloodorb", 1, "bloodmagic:altar/apprenticebloodorb")

  altar(100, 5, 5, "stoneopolis:void_nugget", "stoneopolis:void_copper_nugget", 1, "stoneopolis:void_copper_nugget_altar")

  altar(100, 5, 5, "caveopolis:mixed_stone_nugget", 'stoneopolis:void_tin_nugget', 1, "stoneopolis:void_tin_nugget_altar")
  altar(100, 5, 5, "opolisutilities:mini_charcoal", 'opolisutilities:mini_coal', 1, "stoneopolis:mini_coal")
 
  altar(150, 5, 5, "caveopolis:stone_stick", 'stoneopolis:routing_stick', 1, "stoneopolis:routing_stick")
  altar(1000, 29, 20, "bloodmagic:sacrificialdagger", 'bloodmagic:daggerofsacrifice', 1, "bloodmagic:altar/daggerofsacrifice")
  altar(1000, 5, 5, "stoneopolis:empty_budding_stone", 'geode_plus:budding_redstone', 1, "stoneopolis:budding_redstone")
  altar(200, 5, 5, "woodenhopper:wooden_hopper", "bloodmagic:itemrouterfilterexact", 1, "bloodmagic:alchemytable/router_filter")
  altar(200, 20, 20, "minecraft:ancient_debris", "minecraft:netherite_scrap", 2, "stoneopolis:netherite_scrap_altar")

  altar(100000, 1000, 1000, "stoneopolis:canvas_of_nothing", "dimpaintings:end_painting", 4, "dimpaintings:end_painting")

  altar(5000, 500, 500, "strainers:everlasting_mesh_upgrade", "strainers:specialized_mesh_upgrade", 4, "strainers:specialized_mesh_upgrade")
  altar(5000, 500, 500, "strainers:everlasting_output_upgrade", "strainers:specialized_output_upgrade", 4, "strainers:specialized_output_upgrade")
  altar(5000, 500, 500, "strainers:everlasting_duration_upgrade", "strainers:specialized_speed_upgrade", 4, "strainers:specialized_duration_upgrade")
  altar(5000, 500, 500, "strainers:everlasting_input_upgrade", "strainers:specialized_input_upgrade", 4, "strainers:specialized_input_upgrade")

  //Functions

  function altar(lifeDrain, consumptionRate, drainRate, inItem, outItem, level, recipeID){
    event.custom({
      type: "bloodmagic:altar",
      altarSyphon: lifeDrain,
      consumptionRate: consumptionRate,
      drainRate: drainRate,
      input: {item: inItem},
      output: {item: outItem},
      upgradeLevel: level
    }).id(recipeID)
  }


  function altarComplex(lifeDrain, consumptionRate, drainRate, inItem, outItem, level, recipeID){
    event.custom({
      type: "bloodmagic:altar",
      altarSyphon: lifeDrain,
      consumptionRate: consumptionRate,
      drainRate: drainRate,
      input: {item: inItem},
      output: outItem,
      upgradeLevel: level
    }).id(recipeID)
  }

  //Orb Reverting Fixes

  event.custom({
    "type": "bloodmagic:arc",
    "consumeingredient": true,
    "input": {
      "item": "bloodmagic:weakbloodorb"
    },
    "inputsize": 1,
    "mainoutputchance": 0.0,
    "output": {
      "item": "stoneopolis:void_ingot"
    },
    "tool": {
      "tag": "bloodmagic:arc/reverter"
    }
  }).id("bloodmagic:arc/reversion/weak_blood_orb")

  event.custom({
    "type": "bloodmagic:arc",
    "consumeingredient": true,
    "input": {
      "item": "bloodmagic:apprenticebloodorb"
    },
    "inputsize": 1,
    "mainoutputchance": 0.0,
    "output": {
      "item": "minecraft:copper_block"
    },
    "tool": {
      "tag": "bloodmagic:arc/reverter"
    }
  }).id("bloodmagic:arc/reversion/apprentice_blood_orb")

  event.custom({
    "type": "bloodmagic:arc",
    "addedoutput": [
      {
        "type": {
          "count": 4,
          "item": "minecraft:gold_ingot"
        },
        "chance": 0.0,
        "mainchance": 1.0
      },
      {
        "type": {
          "count": 1,
          "item": "minecraft:echo_shard"
        },
        "chance": 0.0,
        "mainchance": 1.0
      }
    ],
    "consumeingredient": false,
    "input": {
      "item": "minecraft:netherite_ingot"
    },
    "inputsize": 1,
    "mainoutputchance": 0.0,
    "output": {
      "count": 4,
      "item": "alltheores:netherite_dust"
    },
    "tool": {
      "tag": "bloodmagic:arc/reverter"
    }
  }).id("bloodmagic:arc/reversion/netherite_ingot")

})
