// priority: 0

settings.logAddedRecipes = true
settings.logRemovedRecipes = true
settings.logSkippedRecipes = false
settings.logErroringRecipes = true

console.info('Server scripts reloaded!')

onEvent('recipes', event => {

  // General/misc recipe fixes
	
	event.remove({output: '#forge:rods/iron'})
	event.shaped(Item.of('buildersaddition:iron_rod', 2), [
		'I',
		'I'
	], {
		I: 'minecraft:iron_ingot'
	})
	event.remove({output: 'immersiveengineering:stick_steel'})
	event.shapeless('mapperbase:steel_rod', ['immersiveengineering:hammer', '#forge:ingots/steel'])
	event.remove({output: 'immersiveengineering:plate_steel'})
	event.shapeless('mapperbase:steel_plate', ['immersiveengineering:hammer', '#forge:ingots/steel'])
	event.remove({output: 'quark:iron_ladder'})
	event.remove({output: 'immersiveengineering:metal_ladder_none'})
	event.remove({output: 'mcwbridges:iron_platform'})
	event.shaped(Item.of('mcwbridges:iron_platform', 3), [
		'SSS'
	], {
		S: 'create:iron_sheet'
	})
	event.remove({output: 'mapperbase:iron_plate'})
	event.remove({output: 'immersiveengineering:plate_iron'})
	event.remove({output: 'mapperbase:flatter_hammer'})
	event.shapeless('create:iron_sheet', ['immersiveengineering:hammer', 'minecraft:iron_ingot'])
	event.remove({output: 'mcwbridges:iron_rod'})
	event.remove({output: 'mcwbridges:iron_armrest'})
	event.shaped('mcwbridges:iron_armrest', [
		'NRN'
	], {
		N: 'minecraft:iron_nugget',
		R: '#forge:rods/iron'
	})
	event.remove({output: 'platforms:wrench'})
	event.shaped('platforms:wrench', [
		' II',
		' B ',
		'BR '
	], {
		I: 'minecraft:iron_ingot',
		B: '#forge:rods/all_metal',
		R: '#forge:dyes/red'
	})
	event.shaped(Item.of('blockcarpentry:frameblock', 4), [
		'WWW',
		'S S',
		'WWW'
	], {
		W: '#minecraft:wooden_slabs',
		S: 'minecraft:stick'
	})
	event.shapeless(Item.of('minecraft:diorite', 3), ['minecraft:cobblestone', 'minecraft:cobblestone', '#forge:stone'])
	event.shapeless('mana-and-artifice:guide_book', ['minecraft:book', 'mana-and-artifice:vinteum_dust'])
	event.remove({output: 'astralsorcery:wand'})
	event.shaped('astralsorcery:wand', [
		' AD',
		' MA',
		'M  '
	], {
		A: 'astralsorcery:aquamarine',
		D: 'minecraft:diamond',
		M: 'astralsorcery:marble_raw'
	})
	event.shapeless(Item.of('minecraft:flint', 2), ['minecraft:gravel', 'minecraft:gravel', 'minecraft:gravel'])
	event.shapeless('immersiveengineering:steel_fence', ['mapperbase:steel_fence'])
	event.shapeless('minecraft:chest', ['#forge:chests/wooden'])
	event.stonecutting('embellishcraft:marble', 'astralsorcery:marble_raw')
	event.stonecutting('quark:marble', 'astralsorcery:marble_raw')
	event.stonecutting('embellishcraft:marble', 'quark:marble')
	event.stonecutting('quark:marble', 'embellishcraft:marble')
	event.stonecutting('astralsorcery:marble_raw', 'quark:marble')
	event.stonecutting('astralsorcery:marble_raw', 'embellishcraft:marble')
	event.replaceInput({}, 'mekanism:ingot_lead', 'eidolon:lead_ingot')
	event.replaceOutput({}, 'mekanism:ingot_lead', 'eidolon:lead_ingot')
	event.replaceOutput({}, 'mekanism:nugget_lead', 'eidolon:lead_nugget')

  // Ingot Stuff

	event.remove({output: 'mapperbase:steel_ingot'})
	event.remove({output: 'immersiveengineering:ingot_steel'})
	event.remove({output: 'create:copper_ingot'})
	event.remove({output: 'immersiveengineering:copper_ingot'})
	event.remove({output: 'immersiveengineering:ingot_lead'})
	event.remove({output: 'mekanism:ingot_lead'})
	event.remove({output: 'immersiveengineering:ingot_uranium'})
	event.remove({output: 'appliedenergistics2:iron_dust'})

  // Stone stuff?

	event.smelting('minecraft:granite', 'create:granite_cobblestone')
	event.smelting('minecraft:diorite', 'create:diorite_cobblestone')
	event.smelting('minecraft:andesite', 'create:andesite_cobblestone')
	event.smelting('create:limestone', 'create:limestone_cobblestone')
	event.smelting('create:weathered_limestone', 'create:weathered_limestone_cobblestone')
	event.smelting('create:dolomite', 'create:dolomite_cobblestone')
	event.smelting('create:gabbro', 'create:gabbro_cobblestone')
	event.smelting('create:scoria', 'create:scoria_cobblestone')
	event.smelting('create:dark_scoria', 'create:dark_scoria_cobblestone')
	event.smelting('embellishcraft:basalt', 'embellishcraft:basalt_cobblestone')
	event.smelting('embellishcraft:slate', 'embellishcraft:slate_cobblestone')
	event.smelting('embellishcraft:marble', 'embellishcraft:marble_cobblestone')
	event.smelting('embellishcraft:gneiss', 'embellishcraft:gneiss_cobblestone')
	event.smelting('embellishcraft:jade', 'embellishcraft:jade_cobblestone')
	event.smelting('embellishcraft:larvikite', 'embellishcraft:larvikite_cobblestone')

  // AE2 recipes
  
	event.shaped('appliedenergistics2:calculation_processor_press', [
		'III',
		'ICI',
		'III'
	], {
		I: 'minecraft:iron_ingot',
		C: 'appliedenergistics2:purified_certus_quartz_crystal'
	})
	event.shaped('appliedenergistics2:engineering_processor_press', [
		'III',
		'IDI',
		'III'
	], {
		I: 'minecraft:iron_ingot',
		D: 'minecraft:diamond'
	})
	event.shaped('appliedenergistics2:logic_processor_press', [
		'III',
		'IGI',
		'III'
	], {
		I: 'minecraft:iron_ingot',
		G: 'minecraft:gold_ingot'
	})
	event.shaped('appliedenergistics2:silicon_press', [
		'III',
		'ISI',
		'III'
	], {
		I: 'minecraft:iron_ingot',
		S: 'appliedenergistics2:silicon'
	})
	event.shaped(Item.of('appliedenergistics2:sky_stone_block', 8), [
		'BCB',
		'COC',
		'BCB'
	], {
		B: 'minecraft:coal_block',
		C: 'appliedenergistics2:purified_certus_quartz_crystal',
		O: 'minecraft:obsidian'
	})

  // IE recipes
	
	event.recipes.immersiveengineering.crusher('appliedenergistics2:sky_dust', 'appliedenergistics2:sky_stone_block')
	event.recipes.immersiveengineering.crusher('appliedenergistics2:sky_dust', 'appliedenergistics2:smooth_sky_stone_block')
	event.recipes.immersiveengineering.arc_furnace(['appliedenergistics2:smooth_sky_stone_block'], 'appliedenergistics2:sky_stone_block')
	event.recipes.immersiveengineering.arc_furnace(['appliedenergistics2:sky_stone_block'], 'appliedenergistics2:sky_dust')

	event.shaped(Item.of('immersiveengineering:blueprint').nbt({blueprint: "electrode"}), [
		' H ',
		'LLL',
		'PPP'
	], {
		H: 'immersiveengineering:ingot_hop_graphite',
		L: 'minecraft:lapis_lazuli',
		P: 'minecraft:paper'
	})

	event.recipes.immersiveengineering.crusher('appliedenergistics2:ender_dust', 'minecraft:ender_pearl')
	event.recipes.immersiveengineering.crusher('appliedenergistics2:fluix_dust', 'appliedenergistics2:fluix_crystal')
	event.recipes.immersiveengineering.crusher('appliedenergistics2:certus_quartz_dust', '#forge:gems/certus_quartz')
	event.recipes.immersiveengineering.crusher('mekanism:dust_lapis_lazuli', 'minecraft:lapis_lazuli')
	event.recipes.immersiveengineering.crusher('mekanism:dust_charcoal', 'minecraft:charcoal')
	event.recipes.immersiveengineering.crusher('appliedenergistics2:nether_quartz_dust', 'minecraft:quartz')
	event.recipes.immersiveengineering.crusher('mekanism:dust_emerald', 'minecraft:emerald')
	event.recipes.immersiveengineering.crusher('mekanism:dust_diamond', 'minecraft:diamond')
	event.recipes.immersiveengineering.crusher('mekanism:dust_netherite', 'minecraft:netherite_ingot')
	event.recipes.immersiveengineering.crusher(Item.of('mekanism:dust_obsidian', 4), 'minecraft:obsidian')
	event.recipes.immersiveengineering.arc_furnace('mana-and-artifice:vinteum_dust', 'mana-and-artifice:vinteum_ore')
	event.recipes.immersiveengineering.crusher(Item.of('mana-and-artifice:vinteum_dust', 2), 'mana-and-artifice:vinteum_ore')
	event.recipes.immersiveengineering.crusher(Item.of('astralsorcery:rock_crystal', 4), 'astralsorcery:rock_crystal_ore')
	event.recipes.immersiveengineering.crusher(Item.of('appliedenergistics2:certus_quartz_crystal', 4), 'appliedenergistics2:quartz_ore')
	event.recipes.immersiveengineering.crusher(Item.of('appliedenergistics2:charged_certus_quartz_crystal', 4), 'appliedenergistics2:charged_quartz_ore')
	event.recipes.immersiveengineering.arc_furnace('astralsorcery:starmetal_ingot', 'astralsorcery:starmetal_ore')
	event.recipes.immersiveengineering.crusher(Item.of('astralsorcery:stardust', 2), 'astralsorcery:starmetal_ore')
	event.recipes.immersiveengineering.arc_furnace('astralsorcery:starmetal_ingot', 'astralsorcery:stardust')
	event.recipes.immersiveengineering.crusher('astralsorcery:stardust', 'astralsorcery:starmetal_ingot')
	event.recipes.immersiveengineering.arc_furnace('elementalcraft:inertcrystal', 'elementalcraft:crystalore')
	event.remove({id: 'immersiveengineering:crusher/ore_quartz'})
	event.recipes.immersiveengineering.crusher(Item.of('minecraft:quartz', 6), 'minecraft:nether_quartz_ore')
	event.recipes.immersiveengineering.arc_furnace('mana-and-artifice:vinteum_ingot', 'mana-and-artifice:vinteum_coated_iron')
	event.recipes.immersiveengineering.arc_furnace('mana-and-artifice:purified_vinteum_ingot', 'mana-and-artifice:purified_vinteum_coated_iron')
	event.recipes.immersiveengineering.crusher(Item.of('create:crushed_zinc_ore', 2), 'create:zinc_ore')
	event.recipes.immersiveengineering.crusher(Item.of('mekanism:dust_lead', 2), '#forge:ores/lead')
	event.recipes.immersiveengineering.arc_furnace('eidolon:lead_ingot', 'create:crushed_lead_ore')
	event.recipes.immersiveengineering.arc_furnace('eidolon:lead_ingot', '#forge:dusts/lead')
	event.recipes.immersiveengineering.crusher('minecraft:cobblestone', 'minecraft:stone')
	event.recipes.immersiveengineering.crusher('create:granite_cobblestone', 'minecraft:granite')
	event.recipes.immersiveengineering.crusher('create:diorite_cobblestone', 'minecraft:diorite')
	event.recipes.immersiveengineering.crusher('create:andesite_cobblestone', 'minecraft:andesite')
	event.recipes.immersiveengineering.crusher('create:limestone_cobblestone', 'create:limestone')
	event.recipes.immersiveengineering.crusher('create:dolomite_cobblestone', 'create:dolomite')
	event.recipes.immersiveengineering.crusher('create:gabbro_cobblestone', 'create:gabbro')
	event.recipes.immersiveengineering.crusher('create:scoria_cobblestone', 'create:scoria')
	event.recipes.immersiveengineering.crusher('create:weathered_limestone_cobblestone', 'create:weathered_limestone')
	event.recipes.immersiveengineering.crusher('create:dark_scoria_cobblestone', 'create:dark_scoria')
	event.recipes.immersiveengineering.crusher('embellishcraft:basalt_cobblestone', 'embellishcraft:basalt')
	event.recipes.immersiveengineering.crusher('embellishcraft:slate_cobblestone', 'embellishcraft:slate')
	event.recipes.immersiveengineering.crusher('embellishcraft:marble_cobblestone', 'embellishcraft:marble')
	event.recipes.immersiveengineering.crusher('embellishcraft:gneiss_cobblestone', 'embellishcraft:gneiss')
	event.recipes.immersiveengineering.crusher('embellishcraft:jade_cobblestone', 'embellishcraft:jade')
	event.recipes.immersiveengineering.crusher('embellishcraft:larvikite_cobblestone', 'embellishcraft:larvikite')

  // Mekanism recipes

	event.recipes.mekanism.crushing('immersiveengineering:dust_coke', 'immersiveengineering:coal_coke')
	event.remove({output: 'mekanism:dust_quartz'})
	event.recipes.mekanism.crushing('appliedenergistics2:nether_quartz_dust', 'minecraft:quartz')
	event.recipes.mekanism.enriching(Item.of('mana-and-artifice:vinteum_dust', 2), 'mana-and-artifice:vinteum_ore')
	event.recipes.mekanism.enriching(Item.of('astralsorcery:rock_crystal', 4), 'astralsorcery:rock_crystal_ore')
	event.recipes.mekanism.smelting('astralsorcery:starmetal_ingot', 'astralsorcery:starmetal_ore')
	event.recipes.mekanism.enriching(Item.of('astralsorcery:stardust', 2), 'astralsorcery:starmetal_ore')
	event.recipes.mekanism.smelting('astralsorcery:starmetal_ingot', 'astralsorcery:stardust')
	event.recipes.mekanism.crushing('astralsorcery:stardust', 'astralsorcery:starmetal_ingot')
	event.recipes.mekanism.enriching(Item.of('create:crushed_zinc_ore', 2), 'create:zinc_ore')
	event.recipes.mekanism.enriching(Item.of('immersiveengineering:dust_aluminum', 2), 'immersiveengineering:ore_aluminum')
	event.recipes.mekanism.enriching(Item.of('immersiveengineering:dust_silver', 2), 'immersiveengineering:ore_silver')
	event.recipes.mekanism.enriching(Item.of('immersiveengineering:dust_nickel', 2), 'immersiveengineering:ore_nickel')
	event.recipes.mekanism.enriching(Item.of('mekanism:dust_lead', 2), '#forge:ores/lead')
	event.recipes.mekanism.crushing('create:granite_cobblestone', 'minecraft:granite')
	event.recipes.mekanism.crushing('create:diorite_cobblestone', 'minecraft:diorite')
	event.recipes.mekanism.crushing('create:andesite_cobblestone', 'minecraft:andesite')
	event.recipes.mekanism.crushing('create:limestone_cobblestone', 'create:limestone')
	event.recipes.mekanism.crushing('create:dolomite_cobblestone', 'create:dolomite')
	event.recipes.mekanism.crushing('create:gabbro_cobblestone', 'create:gabbro')
	event.recipes.mekanism.crushing('create:scoria_cobblestone', 'create:scoria')
	event.recipes.mekanism.crushing('create:weathered_limestone_cobblestone', 'create:weathered_limestone')
	event.recipes.mekanism.crushing('create:dark_scoria_cobblestone', 'create:dark_scoria')
	event.recipes.mekanism.crushing('embellishcraft:basalt_cobblestone', 'embellishcraft:basalt')
	event.recipes.mekanism.crushing('embellishcraft:slate_cobblestone', 'embellishcraft:slate')
	event.recipes.mekanism.crushing('embellishcraft:marble_cobblestone', 'embellishcraft:marble')
	event.recipes.mekanism.crushing('embellishcraft:gneiss_cobblestone', 'embellishcraft:gneiss')
	event.recipes.mekanism.crushing('embellishcraft:jade_cobblestone', 'embellishcraft:jade')
	event.recipes.mekanism.crushing('embellishcraft:larvikite_cobblestone', 'embellishcraft:larvikite')

  // Create recipes
	
	event.recipes.create.pressing('mapperbase:steel_plate', '#forge:ingots/steel')
	event.recipes.create.crushing(Item.of('astralsorcery:rock_crystal', 4), 'astralsorcery:rock_crystal_ore')
	event.recipes.create.crushing(Item.of('astralsorcery:stardust', 2), 'astralsorcery:starmetal_ore')
	event.recipes.create.crushing(Item.of('mekanism:fluorite_gem', 6), 'mekanism:fluorite_ore')
	event.recipes.create.crushing(Item.of('mana-and-artifice:vinteum_dust', 2), 'mana-and-artifice:vinteum_ore')
	event.recipes.create.crushing('appliedenergistics2:fluix_dust', 'appliedenergistics2:fluix_crystal')
	event.recipes.create.crushing('minecraft:cobblestone', 'minecraft:stone')
	event.recipes.create.crushing('create:granite_cobblestone', 'minecraft:granite')
	event.recipes.create.crushing('create:diorite_cobblestone', 'minecraft:diorite')
	event.recipes.create.crushing('create:andesite_cobblestone', 'minecraft:andesite')
	event.recipes.create.crushing('create:limestone_cobblestone', 'create:limestone')
	event.recipes.create.crushing('create:dolomite_cobblestone', 'create:dolomite')
	event.recipes.create.crushing('create:gabbro_cobblestone', 'create:gabbro')
	event.recipes.create.crushing('create:scoria_cobblestone', 'create:scoria')
	event.recipes.create.crushing('create:weathered_limestone_cobblestone', 'create:weathered_limestone')
	event.recipes.create.crushing('create:dark_scoria_cobblestone', 'create:dark_scoria')
	event.recipes.create.crushing('embellishcraft:basalt_cobblestone', 'embellishcraft:basalt')
	event.recipes.create.crushing('embellishcraft:slate_cobblestone', 'embellishcraft:slate')
	event.recipes.create.crushing('embellishcraft:marble_cobblestone', 'embellishcraft:marble')
	event.recipes.create.crushing('embellishcraft:gneiss_cobblestone', 'embellishcraft:gneiss')
	event.recipes.create.crushing('embellishcraft:jade_cobblestone', 'embellishcraft:jade')
	event.recipes.create.crushing('embellishcraft:larvikite_cobblestone', 'embellishcraft:larvikite')
	event.remove({id: 'create:milling/andesite'})
	event.recipes.create.milling('minecraft:cobblestone', 'minecraft:stone')
	event.recipes.create.milling('create:granite_cobblestone', 'minecraft:granite')
	event.recipes.create.milling('create:diorite_cobblestone', 'minecraft:diorite')
	event.recipes.create.milling('create:andesite_cobblestone', 'minecraft:andesite')
	event.recipes.create.milling('create:limestone_cobblestone', 'create:limestone')
	event.recipes.create.milling('create:dolomite_cobblestone', 'create:dolomite')
	event.recipes.create.milling('create:gabbro_cobblestone', 'create:gabbro')
	event.recipes.create.milling('create:scoria_cobblestone', 'create:scoria')
	event.recipes.create.milling('create:weathered_limestone_cobblestone', 'create:weathered_limestone')
	event.recipes.create.milling('create:dark_scoria_cobblestone', 'create:dark_scoria')
	event.recipes.create.milling('embellishcraft:basalt_cobblestone', 'embellishcraft:basalt')
	event.recipes.create.milling('embellishcraft:slate_cobblestone', 'embellishcraft:slate')
	event.recipes.create.milling('embellishcraft:marble_cobblestone', 'embellishcraft:marble')
	event.recipes.create.milling('embellishcraft:gneiss_cobblestone', 'embellishcraft:gneiss')
	event.recipes.create.milling('embellishcraft:jade_cobblestone', 'embellishcraft:jade')
	event.recipes.create.milling('embellishcraft:larvikite_cobblestone', 'embellishcraft:larvikite')
	event.remove({id: 'create:milling/andesite'})
	event.remove({output: 'create:andesite_alloy'})
	event.shaped('create:andesite_alloy', [
		'IS',
		'SI'
	], {
		I: 'minecraft:iron_nugget',
		S: '#forge:stone'
	})
	event.shaped('create:andesite_alloy', [
		'ZS',
		'SZ'
	], {
		Z: 'create:zinc_nugget',
		S: '#forge:stone'
	})
	event.recipes.create.mixing('create:andesite_alloy', [
		'#forge:stone',
		'minecraft:iron_nugget'
	])
	event.recipes.create.mixing('create:andesite_alloy', [
		'#forge:stone',
		'create:zinc_nugget'
	])
})

onEvent('item.tags', event => {
  // Get the #forge:cobblestone tag collection and add Diamond Ore to it
  // event.get('forge:cobblestone').add('minecraft:diamond_ore')
  
  // Get the #forge:cobblestone tag collection and remove Mossy Cobblestone from it
  // event.get('forge:cobblestone').remove('minecraft:mossy_cobblestone')
	event.get('forge:dusts/copper').add('create:crushed_copper_ore')
	event.get('forge:dusts/iron').add('create:crushed_iron_ore')
	event.get('forge:dusts/gold').add('create:crushed_gold_ore')
	event.get('forge:dusts/zinc').add('create:crushed_zinc_ore')
	event.get('forge:dusts/brass').add('create:crushed_brass')
	event.get('forge:dusts/osmium').add('create:crushed_osmium_ore')
	event.get('forge:dusts/silver').add('create:crushed_silver_ore')
	event.get('forge:dusts/tin').add('create:crushed_tin_ore')
	event.get('forge:dusts/lead').add('create:crushed_lead_ore')
	event.get('forge:dusts/aluminum').add('create:crushed_aluminum_ore')
	event.get('forge:dusts/uranium').add('create:crushed_uranium_ore')
	event.get('forge:dusts/nickel').add('create:crushed_nickel_ore')
})