// These are all the recipe changes for the Reimagined Modpack. They'll be categorized by group.

// Opening recipe commands.

ServerEvents.recipes(event => {

// Andesite recipe

event.shapeless(
  Item.of('minecraft:andesite', 1), // arg 1: output
  [
    'minecraft:cobblestone',
    'minecraft:gravel', 	       // arg 2: the array of inputs
  ]
)
	
// Silver swap.

event.replaceInput(
  {}, // Arg 1: the filter
  'galosphere:silver_ingot',            // Arg 2: the item to replace
  'caverns_and_chasms:silver_ingot'         // Arg 3: the item to replace it with
  // Note: tagged fluid ingredients do not work on Fabric, but tagged items do.
)

// Swap spinel with soulstone

event.replaceInput(
  {}, // Arg 1: the filter
  'caverns_and_chasms:spinel',            // Arg 2: the item to replace
  'malum:processed_soulstone'         // Arg 3: the item to replace it with
  // Note: tagged fluid ingredients do not work on Fabric, but tagged items do.
)

//Consolidate ropes to supplementaries rope.

event.remove({ output: 'supplementaries:rope' })
event.remove({ output: 'quark:rope' })

event.replaceInput(
  { input: 'supplementaries:rope' }, // Arg 1: the filter
  'supplementaries:rope',            // Arg 2: the item to replace
  'farmersdelight:rope'         // Arg 3: the item to replace it with
  // Note: tagged fluid ingredients do not work on Fabric, but tagged items do.
)

event.replaceInput(
  { input: 'quark:rope' }, // Arg 1: the filter
  'quark:rope',            // Arg 2: the item to replace
  'farmersdelight:rope'         // Arg 3: the item to replace it with
  // Note: tagged fluid ingredients do not work on Fabric, but tagged items do.
)

//Add recipe for nametags.

event.shaped(
  Item.of('minecraft:name_tag', 1), // arg 1: output
  [
    ' B ',
    ' B ', // arg 2: the shape (array of strings)
    ' A '
  ],
  {
    A: 'minecraft:paper',
	B: 'create:iron_sheet'
  }
)

// Enchanting infuser and spell table recipes

event.remove({ output: 'enchantinginfuser:enchanting_infuser' })
event.remove({ output: 'spell_engine:spell_binding' })

event.shaped(
  Item.of('enchantinginfuser:enchanting_infuser', 1), // arg 1: output
  [
    ' C ',
    'BDB', // arg 2: the shape (array of strings)
    'AAA'
  ],
  {
    A: 'minecraft:obsidian',
	B: 'wizards_reborn:arcanum_dust',
	C: 'minecraft:book',
	D: 'malum:processed_soulstone'
  }
)

event.shaped(
  Item.of('spell_engine:spell_binding', 1), // arg 1: output
  [
    ' C ',
    'BBB', // arg 2: the shape (array of strings)
    'AAA'
  ],
  {
    A: 'minecraft:andesite',
	B: 'wizards_reborn:arcanum_dust',
	C: 'minecraft:book'
  }
)

// Smelt rotten flesh into leather.

event.smoking('minecraft:leather', 'minecraft:rotten_flesh').xp(0.15)

event.campfireCooking('minecraft:leather', 'minecraft:rotten_flesh', 0.15, 20)

// Recipe changes for tom's simple storage.

event.remove({ output: 'toms_storage:ts.inventory_connector' })
event.remove({ output: 'toms_storage:ts.crafting_terminal' })
event.remove({ output: 'toms_storage:ts.storage_terminal' })

event.shaped(
  Item.of('toms_storage:ts.inventory_connector', 1), // arg 1: output
  [
    'A B',
    ' C ', // arg 2: the shape (array of strings)
    'B A'
  ],
  {
    A: 'minecraft:copper_ingot',
    B: 'create:andesite_casing',  //arg 3: the mapping object
    C: 'minecraft:chest'
  }
)

event.shaped(
  Item.of('toms_storage:ts.storage_terminal', 1), // arg 1: output
  [
    'A B',
    ' C ', // arg 2: the shape (array of strings)
    'B A'
  ],
  {
    A: 'create:andesite_alloy',
    B: 'minecraft:redstone',  //arg 3: the mapping object
    C: 'create:andesite_casing'
  }
)

event.shaped(
  Item.of('toms_storage:ts.crafting_terminal', 1), // arg 1: output
  [
    'A B',
    ' C ', // arg 2: the shape (array of strings)
    'B A'
  ],
  {
    A: 'minecraft:copper_ingot',
    B: 'minecraft:crafting_table',  //arg 3: the mapping object
    C: 'toms_storage:ts.storage_terminal'
  }
)
// Recipe changes for backpacked

event.shaped(
  Item.of('backpacked:backpack', 1), // arg 1: output
  [
    'ACA',
    ' B ', // arg 2: the shape (array of strings)
    'A A'
  ],
  {
    A: 'minecraft:leather',
    B: 'minecraft:chest',  //arg 3: the mapping object
    C: 'create:iron_sheet'
  }
)

// Eyes of ender require variety

event.remove({ output: 'minecraft:ender_eye' })

event.shaped(
  Item.of('minecraft:ender_eye', 6), // arg 1: output
  [
    'ABC',
    'DEF', // arg 2: the shape (array of strings)
    'GHI'
  ],
  {
    A: 'minecraft:blaze_rod',
    B: 'trials:breeze_rod',  //arg 3: the mapping object
    C: 'mowziesmobs:bluff_rod',
	D: 'minecraft:echo_shard',
	E: 'minecraft:ender_pearl',
	F: 'minecraft:prismarine_shard',
	G: 'minecraft:netherite_scrap',
	H: 'aether:enchanted_gravitite',
	I: 'create:sturdy_sheet'
  }
)

// Cataclysm armor requires warden armor

event.remove({ output: 'cataclysm:ignitium_helmet' })
event.remove({ output: 'cataclysm:ignitium_chestplate' })
event.remove({ output: 'cataclysm:ignitium_boots' })
event.remove({ output: 'cataclysm:ignitium_leggings' })
event.remove({ output: 'cataclysm:cursium_helmet' })
event.remove({ output: 'cataclysm:cursium_chestplate' })
event.remove({ output: 'cataclysm:cursium_boots' })
event.remove({ output: 'cataclysm:cursium_leggings' })

event.smithing(
  'cataclysm:ignitium_helmet',                     // arg 1: output
  'cataclysm:ignitium_upgrade_smithing_template', // arg 2: the smithing template
  'deeperdarker:warden_helmet',                          // arg 3: the item to be upgraded
  'cataclysm:ignitium_ingot'                            // arg 4: the upgrade item
)

event.smithing(
  'cataclysm:ignitium_chestplate',                     // arg 1: output
  'cataclysm:ignitium_upgrade_smithing_template', // arg 2: the smithing template
  'deeperdarker:warden_chestplate',                          // arg 3: the item to be upgraded
  'cataclysm:ignitium_ingot'                            // arg 4: the upgrade item
)

event.smithing(
  'cataclysm:ignitium_boots',                     // arg 1: output
  'cataclysm:ignitium_upgrade_smithing_template', // arg 2: the smithing template
  'deeperdarker:warden_leggings',                          // arg 3: the item to be upgraded
  'cataclysm:ignitium_ingot'                            // arg 4: the upgrade item
)

event.smithing(
  'cataclysm:ignitium_leggings',                     // arg 1: output
  'cataclysm:ignitium_upgrade_smithing_template', // arg 2: the smithing template
  'deeperdarker:warden_boots',                          // arg 3: the item to be upgraded
  'cataclysm:ignitium_ingot'                            // arg 4: the upgrade item
)

event.smithing(
  'cataclysm:cursium_helmet',                     // arg 1: output
  'cataclysm:cursium_upgrade_smithing_template', // arg 2: the smithing template
  'deeperdarker:warden_helmet',                          // arg 3: the item to be upgraded
  'cataclysm:cursium_ingot'                            // arg 4: the upgrade item
)

event.smithing(
  'cataclysm:cursium_chestplate',                     // arg 1: output
  'cataclysm:cursium_upgrade_smithing_template', // arg 2: the smithing template
  'deeperdarker:warden_chestplate',                          // arg 3: the item to be upgraded
  'cataclysm:cursium_ingot'                            // arg 4: the upgrade item
)

event.smithing(
  'cataclysm:cursium_boots',                     // arg 1: output
  'cataclysm:cursium_upgrade_smithing_template', // arg 2: the smithing template
  'deeperdarker:warden_leggings',                          // arg 3: the item to be upgraded
  'cataclysm:cursium_ingot'                            // arg 4: the upgrade item
)

event.smithing(
  'cataclysm:cursium_leggings',                     // arg 1: output
  'cataclysm:cursium_upgrade_smithing_template', // arg 2: the smithing template
  'deeperdarker:warden_boots',                          // arg 3: the item to be upgraded
  'cataclysm:cursium_ingot'                            // arg 4: the upgrade item
)

// Armor requires sheets and netherite requires sturdy sheets

event.replaceInput({ id: 'minecraft:golden_helmet' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'minecraft:golden_chestplate' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'minecraft:golden_leggings' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'minecraft:golden_boots' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'minecraft:iron_helmet' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'minecraft:iron_chestplate' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'minecraft:iron_leggings' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'minecraft:iron_boots' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'simplest_copper_gear:copper_helmet' }, 'minecraft:copper_ingot', 'create:copper_sheet')
event.replaceInput({ id: 'simplest_copper_gear:copper_chestplate' }, 'minecraft:copper_ingot', 'create:copper_sheet')
event.replaceInput({ id: 'simplest_copper_gear:copper_leggings' }, 'minecraft:copper_ingot', 'create:copper_sheet')
event.replaceInput({ id: 'simplest_copper_gear:copper_boots' }, 'minecraft:copper_ingot', 'create:copper_sheet')
event.replaceInput({ id: 'minecraft:chain' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'paladins:paladin_armor_head' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'paladins:paladin_armor_chest' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'paladins:paladin_armor_legs' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'paladins:paladin_armor_feet' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'paladins:crusader_armor_head' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'paladins:crusader_armor_chest' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'paladins:crusader_armor_legs' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'paladins:crusader_armor_feet' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'paladins:paladin_armor_head' }, 'minecraft:copper_ingot', 'create:copper_sheet')
event.replaceInput({ id: 'paladins:paladin_armor_chest' }, 'minecraft:copper_ingot', 'create:copper_sheet')
event.replaceInput({ id: 'paladins:paladin_armor_legs' }, 'minecraft:copper_ingot', 'create:copper_sheet')
event.replaceInput({ id: 'paladins:paladin_armor_feet' }, 'minecraft:copper_ingot', 'create:copper_sheet')
event.replaceInput({ id: 'paladins:crusader_armor_head' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'paladins:crusader_armor_chest' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'paladins:crusader_armor_legs' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'paladins:crusader_armor_feet' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'paladins:prior_robe_head' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'paladins:prior_robe_chest' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'paladins:prior_robe_legs' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'paladins:prior_robe_feet' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'rogues:assassin_armor_head' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'rogues:assassin_armor_chest' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'rogues:assassin_armor_legs' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'rogues:assassin_armor_feet' }, 'minecraft:gold_ingot', 'create:golden_sheet')
event.replaceInput({ id: 'rogues:warrior_armor_head' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'rogues:warrior_armor_chest' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'rogues:warrior_armor_legs' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'rogues:warrior_armor_feet' }, 'minecraft:iron_ingot', 'create:iron_sheet')
event.replaceInput({ id: 'minecraft:netherite_ingot' }, 'minecraft:gold_ingot', 'create:sturdy_sheet')

// Diamond armor mechanical crafter

event.remove({ output: 'minecraft:diamond_chestplate' })
event.remove({ output: 'minecraft:diamond_leggings' })
event.remove({ output: 'minecraft:diamond_boots' })
event.remove({ output: 'minecraft:diamond_helmet' })

	event.recipes.create.mechanical_crafting(
	'diamond_helmet', [
	'AAA',
	'A A'
	], {
	A: 'diamond'
	}).id('minecraft:diamond_helmet')
	event.recipes.create.mechanical_crafting(
	'diamond_chestplate', [
	'A A',
	'AAA',
	'AAA'
	], {
	A: 'diamond'
	}).id('minecraft:diamond_chestplate')
	event.recipes.create.mechanical_crafting(
	'diamond_leggings', [
	'AAA',
	'A A',
	'A A'
	], {
	A: 'diamond'
	}).id('minecraft:diamond_leggings')
	event.recipes.create.mechanical_crafting(
	'diamond_boots', [
	'A A',
	'A A'
	], {
	A: 'diamond'
	}).id('minecraft:diamond_boots')
	
//Closing brackets.

	}
)