//priority: 0
//Aluminium Unification
//'tfmg:aluminum_ingot','electrodynamics:ingotaluminum', 'create_tank_defenses:aluminum_ingot', 'crusty_chunks:aluminum_ingot'
ServerEvents.tags('item', e => {
  e.get('forge:ingots/aluminum').add([
    'tfmg:aluminum_ingot',
    'electrodynamics:ingotaluminum',
	'create_tank_defenses:aluminum_ingot',
    'crusty_chunks:aluminum_ingot'
  ])
})
//Lead Unification
// 'tfmg:lead_ingot','electrodynamics:ingotlead','crusty_chunks:lead_ingot'
ServerEvents.tags('item', e => {
  e.get('forge:ingots/lead').add([
    'tfmg:lead_ingot',
    'electrodynamics:ingotlead',
    'crusty_chunks:lead_ingot'
  ])
})
//Sulfuric Acid Unification
// 'tfmg:sulfuric_acid','vintageimprovements:sulfuric_acid'
ServerEvents.tags('fluid', e => {
  e.get('forge:sulfuric_acid').add([
    'tfmg:sulfuric_acid',
    'vintageimprovements:sulfuric_acid'
  ])
})
//Sulfur Unification
// 'tfmg:sulfur_dust, crusty_chunks:sulfur'
ServerEvents.tags('item', e => {
  e.get('forge:dusts/sulfur').add([
    'tfmg:sulfur_dust',
  ])
  e.get('forge:dusts/sulfur').remove([
    'crusty_chunks:sulfur',
  ])
})
//Aluminum Unification
// 'create_tank_defenses:aluminum_dust, crusty_chunks:aluminum_dust'
ServerEvents.tags('item', e => {
  e.get('forge:dusts/aluminum').add([
    'create_tank_defenses:aluminum_dust',
	'crusty_chunks:aluminum_dust'
  ])
})
	//Helve Hammering
ServerEvents.recipes(event => {
	// Added recipes below
	event.recipes.vintageimprovementsHammering(Item.of('crusty_chunks:steelplate', 4), 'tfmg:steel_ingot', 2)
	event.recipes.vintageimprovementsHammering(Item.of('crusty_chunks:copper_plate', 4), 'minecraft:copper_ingot', 2)
	event.recipes.vintageimprovementsHammering(Item.of('crusty_chunks:brass_plate', 4), 'create:brass_ingot', 2)
	event.recipes.vintageimprovementsHammering(Item.of('crusty_chunks:aluminum_plate', 4), '#forge:ingots/aluminum', 2)
	event.recipes.vintageimprovementsHammering(Item.of('crusty_chunks:small_unbored_cannon_barrel', 1), 'crusty_chunks:bent_component', 2)
	event.recipes.vintageimprovementsHammering(Item.of('crusty_chunks:large_unbored_cannon_barrel', 1), 'electrodynamics:ingotstainlesssteel', 4)
	event.recipes.vintageimprovementsHammering(Item.of('crusty_chunks:huge_unbored_cannon_barrel', 1), 'electrodynamics:resourceblockstainlesssteel', 8)

})
	//Conveyor Lift Replace
ServerEvents.recipes(event => {
	event.replaceInput(
		{ input: 'crusty_chunks:conveyor_lift' },
		'crusty_chunks:conveyor_lift',
		'crusty_chunks:steel_gear'
)
})
	//Curving Press
ServerEvents.recipes(event => {
		// Added recipes below
	event.recipes.vintageimprovements.curving('crusty_chunks:bent_component', 'tfmg:steel_ingot').mode(3).headDamage(4)
})
	//Lathe
ServerEvents.recipes(event => {
		// Added recipes below
	event.recipes.vintageimprovements.turning(Item.of('create:fluid_pipe', 24), 'minecraft:copper_block').processingTime(300)
	event.recipes.vintageimprovements.turning(Item.of('tfmg:plastic_pipe', 24), '#forge:storage_blocks/plastic').processingTime(300)
	event.recipes.vintageimprovements.turning(Item.of('tfmg:aluminum_pipe', 24), '#forge:storage_blocks/aluminum').processingTime(300)
	event.recipes.vintageimprovements.turning(Item.of('tfmg:cast_iron_pipe', 24), '#forge:storage_blocks/cast_iron').processingTime(300)
	event.recipes.vintageimprovements.turning(Item.of('tfmg:steel_pipe', 24), '#forge:storage_blocks/steel').processingTime(500)
		// Duplicate Inputs have a selection window in the Lathe GUI
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:wood_component', 12), '#minecraft:planks').processingTime(200)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:cast_component', 8), 'tfmg:steel_ingot').processingTime(500)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:steel_tube', 8), 'crusty_chunks:steelplate').processingTime(400)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:steel_cylinder', 16), '#forge:storage_blocks/steel').processingTime(600)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:steel_wire', 8), 'vintageimprovements:steel_rod').processingTime(500)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:copper_wire', 8), 'createaddition:copper_rod').processingTime(150)
		//Casings
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:small_casing', 16), 'create:brass_ingot').processingTime(100)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:medium_casing', 8), 'create:brass_ingot').processingTime(150)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:large_casing', 4), 'create:brass_ingot').processingTime(200)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:huge_casing', 2), 'create:brass_ingot').processingTime(250)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:shotgun_casing', 2), 'create:brass_ingot').processingTime(250)
		//Barrels
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:small_bored_barrel', 1), 'tfmg:steel_ingot').processingTime(250)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:medium_bored_barrel', 1), 'tfmg:steel_ingot').processingTime(250)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:large_bored_barrel', 1), 'tfmg:steel_ingot').processingTime(500)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:huge_bored_barrel', 1), 'tfmg:steel_ingot').processingTime(500)
		//Heavy Barrels
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:battle_cannon_barrel', 1), 'crusty_chunks:large_unbored_cannon_barrel').processingTime(500)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:artillery_barrel', 1), 'crusty_chunks:huge_unbored_cannon_barrel').processingTime(750)
		//Shells
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:hollowed_large_projectile', 2), 'crusty_chunks:large_projectile').processingTime(100)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:hollowed_extra_large_projectile', 2), 'crusty_chunks:extra_large_projectile').processingTime(150)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:hollowed_huge_projectile', 2), 'crusty_chunks:huge_projectile').processingTime(200)
	event.recipes.vintageimprovements.turning(Item.of('crusty_chunks:small_hollow_point_bullet', 2), 'crusty_chunks:smallbullet').processingTime(100)
})
	//Mechanical Press
ServerEvents.recipes(event => {
		// Added recipes below
	event.recipes.create.compacting('crusty_chunks:brass_fitting', 'create:brass_ingot').heated()
	event.recipes.create.compacting('crusty_chunks:bored_component', 'tfmg:steel_ingot').heated()
	event.recipes.create.compacting('crusty_chunks:small_projectile', 'create:copper_nugget').heated()
	event.recipes.create.compacting('crusty_chunks:medium_projectile', '#forge:nuggets/lead').heated()
	event.recipes.create.compacting('crusty_chunks:large_projectile', '#forge:nuggets/steel').heated()
	event.recipes.create.compacting('crusty_chunks:extra_large_projectile', 'electrodynamics:nuggetstainlesssteel').heated()
	event.recipes.create.compacting('crusty_chunks:huge_projectile', 'electrodynamics:ingotstainlesssteel').heated()
})
	//Belt Grinder
ServerEvents.recipes(event => {
		// Added recipes below
	event.recipes.vintageimprovements.polishing('crusty_chunks:steel_spring', 'vintageimprovements:steel_spring').processingTime(500)
	event.recipes.vintageimprovements.polishing('crusty_chunks:copper_coil', 'vintageimprovements:copper_spring').processingTime(500)
	
})
	//Laser
ServerEvents.recipes(event => {
		// Added recipes below
		event.recipes.vintageimprovements.laser_cutting(Item.of('minecraft:iron_bars', 24), 'minecraft:iron_block').energyCost(4000).maxChargeRate(500)
		event.recipes.vintageimprovements.laser_cutting(Item.of('crusty_chunks:cut_component', 4), 'vintageimprovements:steel_rod').energyCost(500).maxChargeRate(500)
		event.recipes.vintageimprovements.laser_cutting(Item.of('crusty_chunks:steel_gear', 2), 'crusty_chunks:steelplate').energyCost(250).maxChargeRate(500)
		event.recipes.vintageimprovements.laser_cutting(Item.of('crusty_chunks:tech_component', 1), 'electrodynamics:circuitbasic').energyCost(2000).maxChargeRate(500)
})
	//Crushing Wheels
ServerEvents.recipes(event => {
	event.recipes.create.crushing(['crusty_chunks:uranium_neutraltiny_dust', Item.of('crusty_chunks:uranium_neutraltiny_dust').withChance(0.2)], 'nuclearscience:uranium238')
	event.recipes.create.crushing(['crusty_chunks:uranium_enriched_tiny_dust', Item.of('crusty_chunks:uranium_enriched_tiny_dust').withChance(0.1)], 'nuclearscience:uranium235')
	event.recipes.create.crushing(['crusty_chunks:plutonium_nugget', Item.of('crusty_chunks:plutonium_nugget').withChance(0.05)], 'nuclearscience:polonium210')
})
	//Shaped and Shapeless recipes
ServerEvents.recipes(event => {
	event.shaped(
		Item.of('crusty_chunks:smoke_bomb'),
			[ 
			  '   ', 
			  ' F ',
			  'PDP'  
			],
			{
			  P: 'crusty_chunks:bent_component',
			  D: 'crusty_chunks:smoke_agent',
			  F: 'crusty_chunks:timed_fuze'
			}
		  )
	event.shaped(
		Item.of('vs_tournament:prop_small'),
			[ 
			  'D D', 
			  ' P ',
			  'D D'  
			],
			{
			  P: 'tfmg:turbine_blade',
			  D: '#forge:plates/iron',
			}
		  )
	event.shaped(
		Item.of('vs_tournament:connector'),
			[ 
			  'DDD', 
			  'DPD',
			  'DDD'  
			],
			{
			  P: 'vs_clockwork:wanderlite_matrix',
			  D: 'tfmg:heavy_machinery_casing',
			}
		  )
	event.shapeless(
			Item.of('crusty_chunks:petrolium_bucket', 1),
			[ 
			  'tfmg:gasoline_bucket',
			]
		  )
	event.shapeless(
			Item.of('crusty_chunks:shaped_charge_fuze', 1),
			[ 
			  'crusty_chunks:timed_fuze',
			]
		  )
})
	//Sequenced Assemblies
ServerEvents.recipes(event => {
    event.recipes.createSequencedAssembly([ // start the recipe
		Item.of('crusty_chunks:implosion_module') // this is the item that will appear in JEI as the result
	],'nuclearscience:canisterlead',[ // the input
		// the transitional item
		event.recipes.createDeploying('kubejs:incomplete_implosion_module',['kubejs:incomplete_implosion_module','crusty_chunks:uranium_neural_ingot']),
		event.recipes.createDeploying('kubejs:incomplete_implosion_module',['kubejs:incomplete_implosion_module','tfmg:steel_mechanism']),
		event.recipes.create.pressing('kubejs:incomplete_implosion_module', 'kubejs:incomplete_implosion_module'),
	]).transitionalItem('create:incomplete_precision_mechanism').loops(2) // set the transitional item and the loops (amount of repetitions)
    event.recipes.createSequencedAssembly([
		Item.of('crusty_chunks:steel_component')
	],'create:precision_mechanism',[
		event.recipes.createDeploying('kubejs:incomplete_mech_component',['kubejs:incomplete_mech_component','crusty_chunks:bent_component']),
		event.recipes.createDeploying('kubejs:incomplete_mech_component',['kubejs:incomplete_mech_component','crusty_chunks:bored_component']),
		event.recipes.createDeploying('kubejs:incomplete_mech_component',['kubejs:incomplete_mech_component','crusty_chunks:cast_component']),
		event.recipes.create.pressing('kubejs:incomplete_mech_component', 'kubejs:incomplete_mech_component'),
	]).transitionalItem('create_sa:incomplete_steam_engine').loops(2)
    event.recipes.createSequencedAssembly([
		Item.of('crusty_chunks:advanced_component')
	],'tfmg:steel_mechanism',[
		event.recipes.createDeploying('kubejs:incomplete_adv_component',['kubejs:incomplete_adv_component','crusty_chunks:bent_component']),
		event.recipes.createDeploying('kubejs:incomplete_adv_component',['kubejs:incomplete_adv_component','crusty_chunks:steel_gear']),
		event.recipes.createDeploying('kubejs:incomplete_adv_component',['kubejs:incomplete_adv_component','crusty_chunks:cut_component']),
		event.recipes.createDeploying('kubejs:incomplete_adv_component',['kubejs:incomplete_adv_component','crusty_chunks:tech_component']),
		event.recipes.create.pressing('kubejs:incomplete_adv_component', 'kubejs:incomplete_adv_component'),
	]).transitionalItem('kubejs:incomplete_logic_mechanism').loops(2)
	event.recipes.createSequencedAssembly([
		Item.of('crusty_chunks:plutonium_core').withChance(9.0),
		Item.of('nuclearscience:plutoniumoxide').withChance(1.0)
	],'#forge:pellets/plutonium',[
		event.recipes.createDeploying('kubejs:incomplete_plutonium_core',['kubejs:incomplete_plutonium_core','nuclearscience:plutoniumoxide']),
		event.recipes.createDeploying('kubejs:incomplete_plutonium_core',['kubejs:incomplete_plutonium_core','crusty_chunks:uranium_enriched_ingot']),
		event.recipes.createDeploying('kubejs:incomplete_plutonium_core',['kubejs:incomplete_plutonium_core','crusty_chunks:plutonium_ingot']),
		event.recipes.create.pressing('kubejs:incomplete_plutonium_core', 'kubejs:incomplete_plutonium_core'),
	]).transitionalItem('kubejs:incomplete_plutonium_core').loops(3)
})
	//Mechanical Crafting
ServerEvents.recipes(event => {
	event.recipes.createMechanicalCrafting('vs_tournament:prop_big', [
		' PCP ',
		'PPCPP',
		'CCICC',
		'PPCPP',
		' PCP '
	], {
		C: 'createaddition:iron_rod',
		P: '#forge:plates/iron',
		I: 'tfmg:turbine_blade'
	})
})
