// priority: 0

onEvent('recipes', e => {
	removeRecipeByID(e, [
		VH("gas_pump"),

		//w/o replace
		/vehicle:fluid_.*/,
		VH("panel"),
	])



	//fuelium
	e.custom({
		"type": M("rotary"),
		"fluidInput": {
			"amount": 1,
			"fluid": VH("fuelium")
		},
		"fluidOutput": {
			"amount": 1,
			"fluid": VH("fuelium")
		},
		"gasInput": {
			"amount": 1,
			"gas": KJ("gaseous_fuelium")
		},
		"gasOutput": {
			"amount": 1,
			"gas": KJ("gaseous_fuelium")
		}
	})
	e.recipes.createMixing(Fluid.of(VH('fuelium'), 4), [Fluid.of(IF('biofuel'), 4), Fluid.of(TC('molten_ender'), 4)]).processingTime(1).heated()



    //wheels
	const wheels = {
		standard: {
			A: CP('iron_1')
		},
		sports: {
			A: CP('gold_1')
		},
		racing: {
			A: CP('diamond_1')
		},
		off_road: {
			A: CP('dirt_1')
		},
		snow: {
			A: MC('blue_ice')
		},
		all_terrain: {
			A: CP('endstone_1')
		},
		plastic: {
			A: IF('plastic')
		},
	}

	for (let wheel in wheels) {
		e.remove({ id: VH(`wheel_${wheel}`) })
		e.recipes.extendedcrafting.shaped_table(VH(`${wheel}_wheel`), [
			' AAA ',
			'AAAAA',
			'AABAA',
			'AAAAA',
			' AAA ',
		], {
			A: wheels[wheel].A,
			B: BT('wheel'),
		}).id(KJ(`${wheel}_wheel`))
	}



	//gas pump
	e.recipes.extendedcrafting.shaped_table(VH(`gas_pump`), [
		' BAB ',
		' BFB ',
		' BDB ',
		' BEB ',
		' BCB ',
	], {
		A: AE2("controller"),
		B: CP('iron_2'),
		C: CP('redstone_3'),
		D: VH('fuel_drum'),
		E: MU('dark_ethereal_glass'),
		F: CR('smart_fluid_pipe'),
	}).id(KJ(`gas_pump`))



	//engines
	const engines = {
		wood: {
			A: MC('#logs'),
			B: F("#ingots/red_alloy"),
		},
		stone: {
			A: CP('stone_2'),
			B: VH("wood_small_engine"),
		},
		iron: {
			A: CP('iron_2'),
			B: VH("stone_small_engine"),
		},
		gold: {
			A: CP('gold_2'),
			B: VH("iron_small_engine"),
		},
		diamond: {
			A: CP('diamond_2'),
			B: VH("gold_small_engine"),
		},
	}

	for (let engine in engines) {
		//small engine
		e.remove({ id: VH(`small_engine_${engine}`) })
		e.recipes.extendedcrafting.shaped_table(VH(`${engine}_small_engine`), [
			'AADAA',
			'AECEA',
			'DEBED',
			'AECEA',
			'AADAA',
		], {
			A: engines[engine].A,
			B: engines[engine].B,
			C: CR("propeller"),
			D: PR_T("#insulated_wire"),
			E: MC("piston"),
		}).id(KJ(`${engine}_small_engine`))

		//large engine
		e.remove({ id: VH(`large_engine_${engine}`) })
		e.recipes.extendedcrafting.shaped_table(VH(`${engine}_large_engine`), [
			'AAADAAA',
			'AEEEEEA',
			'AECCCEA',
			'DECBCED',
			'AECCCEA',
			'AEEEEEA',
			'AAADAAA',
		], {
			A: engines[engine].A,
			B: engines[engine].B,
			C: CR("propeller"),
			D: PR_T("#insulated_wire"),
			E: MC("piston"),
		}).id(KJ(`${engine}_large_engine`))

		//electric engine
		e.remove({ id: VH(`electric_engine_${engine}`) })
		e.recipes.extendedcrafting.shaped_table(VH(`${engine}_electric_engine`), [
			'AAAADAAAA',
			'AEEEEEEEA',
			'AECCCCCEA',
			'AECFFFCEA',
			'DECFBFCED',
			'AECFFFCEA',
			'AECCCCCEA',
			'AEEEEEEEA',
			'AAAADAAAA',
		], {
			A: engines[engine].A,
			B: engines[engine].B,
			C: CR("propeller"),
			D: PR_T("#insulated_wire"),
			E: MC("piston"),
			F: KJ("computation_matrix"),
		}).id(KJ(`${engine}_electric_engine`))
	}
})