// priority: 0
//TR4
settings.logAddedRecipes = true
settings.logRemovedRecipes = true
settings.logSkippedRecipes = false
settings.logErroringRecipes = true

console.info('Hello, World! (You will see this line every time server resources reload)')

onEvent('recipes', event => {
	// Change recipes here

	//Remove recipes for later changing
	event.remove({output: 'cyclic:fisher'})
	event.remove({output: 'malum:crude_scythe'})
	event.remove({output: 'easy_villagers:trader'})
	event.remove({output: 'easy_villagers:auto_trader'})
	event.remove({output: 'easy_villagers:farmer'})
	event.remove({output: 'easy_villagers:breeder'})
	event.remove({output: 'easy_villagers:converter'})
	event.remove({output: 'easy_villagers:iron_farm'})
	event.remove({output: 'easy_piglins:barterer'})
	event.remove({output: 'extrastorage:storagepart_256k'})
	event.remove({output: 'extrastorage:storagepart_1024k'})
	event.remove({output: 'extrastorage:storagepart_4096k'})
	event.remove({output: 'extrastorage:storagepart_16384k'})
	event.remove({output: 'extrastorage:storagepart_16384k_fluid'})
	event.remove({output: 'extrastorage:storagepart_65536k_fluid'})
	event.remove({output: 'extrastorage:storagepart_262144k_fluid'})
	event.remove({output: 'extrastorage:storagepart_1048576k_fluid'})
	event.remove({output: 'extrastorage:disk_256k'})
	event.remove({output: 'extrastorage:disk_1024k'})
	event.remove({output: 'extrastorage:disk_4096k'})
	event.remove({output: 'extrastorage:disk_16384k'})
	event.remove({output: 'extrastorage:disk_16384k_fluid'})
	event.remove({output: 'extrastorage:disk_65536k_fluid'})
	event.remove({output: 'extrastorage:disk_262144k_fluid'})
	event.remove({output: 'extrastorage:disk_1048576k_fluid'})
	event.remove({output: 'extrastorage:block_256k'})
	event.remove({output: 'extrastorage:block_1024k'})
	event.remove({output: 'extrastorage:block_4096k'})
	event.remove({output: 'extrastorage:block_16384k'})
	event.remove({output: 'extrastorage:block_16384k_fluid'})
	event.remove({output: 'extrastorage:block_65536k_fluid'})
	event.remove({output: 'extrastorage:block_262144k_fluid'})
	event.remove({output: 'extrastorage:block_1048576k_fluid'})
	event.remove({output: 'cyclic:gold_bars'})


	//Fisher Recipe
	event.shaped('1x cyclic:fisher', [
		'LWL',
		'WNW',
		'LWL'
	  ], {
		L: 'minecraft:trapped_chest',
		W: 'minecraft:cobweb',
		N: 'aquaculture:neptunium_ingot',
	  })

	  event.shaped('1x malum:crude_scythe', [
		'IIP',
		' WI',
		'W  '
	  ], {
		I: 'minecraft:iron_ingot',
		P: 'malum:processed_soulstone',
		W: 'malum:runewood_planks',
	  })

	//Trader Recipe
	event.shaped('easy_villagers:trader', [
		'GGG',
		'GIG',
		'EAE'
	  ], {
		G: 'minecraft:tinted_glass',
		I: 'simplylight:illuminant_block',
		E: 'minecraft:emerald_block',
		A: 'silentgear:blaze_gold_ingot',
	  })

	//Auto Trader Recipe
	event.shaped('easy_villagers:auto_trader', [
		'ERD',
		'RTR',
		'DRE'
	  ], {
		T: 'easy_villagers:trader',
		E: 'silentgear:azure_electrum_ingot',
		R: 'immersiveengineering:rs_engineering',
		D: 'mekanism:enriched_redstone',
	  })

	//Farmer Recipe
	event.shaped('easy_villagers:farmer', [
		'PPP',
		'ETE',
		'CCC'
	  ], {
		T: 'easy_villagers:trader',
		E: 'minecraft:emerald_block',
		P: 'minecraft:potato',
		C: 'minecraft:carrot',
	  })

	//Breeder Recipe
	event.shaped('easy_villagers:breeder', [
		'BBB',
		'ETE',
		'BBB'
	  ], {
		T: 'easy_villagers:trader',
		E: 'minecraft:emerald_block',
		B: '#minecraft:beds',
	  })

	//Converter Recipe
	event.shaped('easy_villagers:converter', [
		'BBB',
		'ETE',
		'GGG'
	  ], {
		T: 'easy_villagers:trader',
		E: 'minecraft:emerald_block',
		B: 'minecraft:tinted_glass',
		G: 'minecraft:golden_apple',
	  })

	//Iron Farm Recipe
	event.shaped('easy_villagers:iron_farm', [
		'BBB',
		'ETE',
		'SAS'
	  ], {
		T: 'easy_villagers:trader',
		E: 'minecraft:emerald_block',
		B: 'immersiveengineering:plate_iron',
		S: 'create:iron_sheet',
		A: 'cyclic:anvil_void',
	  })

	//Barterer Recipe
	event.shaped('easy_piglins:barterer', [
		'BBB',
		'ETE',
		'SSS'
	  ], {
		T: 'easy_villagers:trader',
		E: 'minecraft:emerald_block',
		B: 'minecraft:gold_block',
		S: 'minecraft:nether_bricks',
	  })

	//Cyclic Gold Bar
	event.shaped('cyclic:gold_bars', [
		'   ',
		'GNG',
		'GGG'
	  ], {
		G: 'minecraft:gold_ingot',
		N: 'minecraft:gold_nugget',
	  })

	//Uranium Essence Fix
	event.shaped('mekanism:ingot_uranium', [
		'TTT',
		'T T',
		'TTT'
	  ], {
		T: 'mysticalagriculture:uranium_essence',
	  })
})

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')
})

// Listen to player login event
onEvent('player.logged_in', event => {
	// Check if player doesn't have "starting_items" stage yet
	if (!event.player.stages.has('starting_items')) {
	  // Add the stage
	  event.player.stages.add('starting_items')
	  // Give some items to player
	  event.player.give('hardcorequesting:quest_book')	  
	  event.player.give('silentgear:pickaxe_blueprint')
	}
  })