// priority: 0

ServerEvents.recipes(event => {

  event.shaped(`1x submerged:wooden_mesh`, ['SSS', 'S S', 'SSS'], { S: stick }).id(`submerged:wooden_mesh`)
  event.shaped(`1x submerged:bone_mesh`, ['SBS', 'BBB', 'SBS'], { B: bone, S: stick }).id(`submerged:bone_mesh`)
  event.shaped(`1x submerged:bronze_mesh`, ['SBS', 'BBB', 'SBS'], { B: bronze_ingot, S: stick }).id(`submerged:bronze_mesh`)
  event.shaped(`1x submerged:wooden_catcher`, ['L L', 'L L', 'LLL'], { L: logs }).id(`submerged:wooden_catcher`)
  event.shaped(`1x submerged:bait_box`, ['SSS', 'PWP', 'PPP'], { P: planks, W: "aquaculture:worm", S: stick }).id(`submerged:bait_box`)
  event.shaped(`1x submerged:wooden_knife`, ['  D', ' D ', 'S  '], { D: "aquaculture:driftwood", S: stick }).id(`submerged:wooden_knife`)
  event.shaped(`1x submerged:skeleton_key`, [' B ', ' SM', ' SM'], { M: "minecraft:bone_meal", B: bone, S: stick }).id(`submerged:skeleton_key`)
  event.shaped(`1x submerged:bone_hammer`, ['OBO', ' S ', ' S '], { O: "minecraft:bone_block", B: bone, S: stick }).id(`submerged:bone_hammer`)
  event.shaped(`2x submerged:charcoal_filter`, [' S ', 'SCS', ' S '], { C: "opolisutilities:mini_charcoal", S: "minecraft:paper" }).id(`submerged:charcoal_filter`)
  event.shaped(`1x submerged:coil`, [' NI', 'NIN', 'IN '], { I: iron_ingot, N: iron_nugget }).id(`submerged:coil`)
  event.shaped(`1x submerged:bedrockium`, ['BBB', 'III', 'BBB'], { B: "bedrockminer:bedrock_chunk", I: iron_ingot }).id(`submerged:bedrockium`)
  event.shaped(`1x submerged:toxic_air_curio`, ['LLL', 'L L', 'LLL'], { L: "thermal:lead_ingot" }).id(`submerged:toxic_air_curio`)
  event.shaped(`1x submerged:water_curio`, ['LFL', 'F F', 'LFL'], { L: "thermal:lead_ingot", F: "thermal:diving_fabric" }).id(`submerged:water_curio`)
  event.shaped(`1x submerged:nether_bedrock_breaker`, ['NNN', 'PSP', 'NNN'], { N: 'thermal:netherite_nugget', S: 'minecraft:netherite_upgrade_smithing_template', P: "minecraft:netherite_pickaxe" }).id(`submerged:nether_bedrock_breaker`)
  event.shaped(`1x submerged:storage_core`, ['DPD', 'BCB', 'DPD'], { B: bronze_nugget, D: "aquaculture:driftwood", P: planks, C: chest }).id(`submerged:storage_core`)
  event.shapeless(`4x submerged:unfired_bronze`, [copper_ingot, copper_ingot, copper_ingot, tin_ingot]).id(`submerged:unfired_bronze`)
  event.shaped(`1x submerged:nether_infused_water_bucket`, ['NSN', 'NBN', 'RRR'], { N: "minecraft:netherrack", S: "minecraft:nether_star", B: 'strainers:purified_water_bucket', R: "minecraft:blaze_rod" }).id(`submerged:nether_infused_water_bucket`)
  event.shaped(`1x submerged:eye_core`, [' 1 ', '2E3', ' 4 '], { E: "minecraft:ender_eye", 1: "submerged:air_block", 2: "submerged:water_block", 3: "submerged:earth_block", 4: "submerged:fire_block" }).id(`submerged:eye_core`)

  event.shaped(`2x submerged:air_block`, ['EEE', 'EBE', 'EEE'], { E: 'mysticalagriculture:air_essence', B: "submerged:air_block" }).id(`submerged:air_block`)
  event.shaped(`2x submerged:fire_block`, ['EEE', 'EBE', 'EEE'], { E: 'mysticalagriculture:fire_essence', B: "submerged:fire_block" }).id(`submerged:fire_block`)
  event.shaped(`2x submerged:water_block`, ['EEE', 'EBE', 'EEE'], { E: 'mysticalagriculture:water_essence', B: "submerged:water_block" }).id(`submerged:water_block`)
  event.shaped(`2x submerged:earth_block`, ['EEE', 'EBE', 'EEE'], { E: 'mysticalagriculture:earth_essence', B: "submerged:earth_block" }).id(`submerged:earth_block`)

  event.shaped(`1x pipe_connector:pipe_connector`, ['PPP', 'P P', 'PPP'], { P: "toms_storage:ts.inventory_cable" }).id(`pipe_connector:pipe_connector`)

  // Gravel Ores

  event.shaped(`1x submerged:iron_gravel_ore`, ['OO', 'OO'], { O: "submerged:iron_ore_piece" }).id(`submerged:iron_gravel_ore`)
  event.shaped(`1x submerged:gold_gravel_ore`, ['OO', 'OO'], { O: "submerged:gold_ore_piece" }).id(`submerged:gold_gravel_ore`)
  event.shaped(`1x submerged:copper_gravel_ore`, ['OO', 'OO'], { O: "submerged:copper_ore_piece" }).id(`submerged:copper_gravel_ore`)
  event.shaped(`1x submerged:tin_gravel_ore`, ['OO', 'OO'], { O: "submerged:tin_ore_piece" }).id(`submerged:tin_gravel_ore`)
  event.shaped(`1x submerged:silver_gravel_ore`, ['OO', 'OO'], { O: "submerged:silver_ore_piece" }).id(`submerged:silver_gravel_ore`)
  event.shaped(`1x submerged:lead_gravel_ore`, ['OO', 'OO'], { O: "submerged:lead_ore_piece" }).id(`submerged:lead_gravel_ore`)
  event.shaped(`1x submerged:nickel_gravel_ore`, ['OO', 'OO'], { O: "submerged:nickel_ore_piece" }).id(`submerged:nickel_gravel_ore`)
  event.shaped(`1x submerged:debris_gravel_ore`, ['OO', 'OO'], { O: "submerged:debris_ore_piece" }).id(`submerged:debris_gravel_ore`)


  // Custom Mulches

  event.shapeless(`2x submerged:sandy_mulch`, ["strainers:mulch", "minecraft:sand"]).id(`submerged:sandy_mulch`)
  event.shapeless(`2x submerged:dirty_mulch`, ["strainers:mulch", "minecraft:dirt"]).id(`submerged:dirty_mulch`)
  event.shapeless(`2x submerged:gravely_mulch`, ["strainers:mulch", "minecraft:gravel"]).id(`submerged:gravely_mulch`)


  // Slabs To Blocks
  event.forEachRecipe({ type: 'minecraft:crafting_shaped', output: '#minecraft:slabs' }, r => {
    let ingredients = r.originalRecipeIngredients
    let output = r.originalRecipeResult
    event.shaped(ingredients[0], ['S', 'S'], { S: output })
  })

  event.shapeless(`1x minecraft:crafting_table`, ['#caveopolis:colored_wooden_plank_crafting_tables']).id(`submerged:crafting_table`)
  event.shaped(`1x minecraft:blast_furnace`, ['SFS', 'SFS', 'CST'], { C: copper_ingot, T: tin_ingot, S: stone, F: furnace }).id(`minecraft:blast_furnace`)
  event.shaped(`1x minecraft:composter`, ['S S', 'SBS', 'SSS'], { S: "#minecraft:wooden_slabs", B: "minecraft:bone_block" }).id(`minecraft:composter`)
  event.shaped(`1x minecraft:dispenser`, ['CCC', 'C C', 'C C'], { C: cobblestone }).id(`minecraft:dispenser`)
  event.shapeless(`1x minecraft:grass_block`, ["minecraft:dirt", "submerged:grass_seed"]).id(`submerged:grass_block`)
  event.shaped(`1x minecraft:netherite_ingot`, ['SGS', 'GBG', 'SGS'], { S: "minecraft:netherite_scrap", G: gold_ingot, B: "submerged:bedrockium" }).id(`minecraft:netherite_ingot`)
  event.shaped(`1x minecraft:shulker_shell`, ['CCC', 'CEC'], { C: "minecraft:crying_obsidian", E: "minecraft:end_stone_bricks" }).id(`minecraft:shulker_shell`)


  event.remove({ id: 'minecraft:crafting_table' })
  event.remove({ output: "#submerged:banned_knifes" })
  event.remove({ output: '#submerged:banned_storage_drawers' })
  event.remove({ output: "#forge:gears", type: "minecraft:crafting_shaped" })
  event.remove({ output: "#forge:ingots", input: "minecraft:fire_charge" })
  event.remove({ output: "#thermal:glass/hardened", input: "minecraft:fire_charge" })
  event.remove({ output: "#forge:dusts", input: "minecraft:fire_charge" })
  event.remove({ output: "#forge:dusts", input: "thermal:earth_charge" })

  event.remove({ input: "#alltheores:ore_hammers" })
  event.remove({ id: "alltheores:lumium_dust_from_alloy_blending" })
  event.remove({ id: "alltheores:signalum_dust_from_alloy_blending" })

  // Replace Inputs
  event.replaceInput({ input: "minecraft:crafting_table" }, "minecraft:crafting_table", "#caveopolis:colored_wooden_plank_crafting_tables")

})