// priority: 0
let MOD = (domain, id, x) => (x ? `${x}x ` : "") + (id.startsWith('#') ? '#' : "") + domain + ":" + id.replace('#', '')
let AD = (id, x) => MOD("ad_astra", id, x)
let CC = (id, x) => MOD("createcasing", id, x)

let colors = ['white', 'orange', 'magenta', 'light_blue', 'lime', 'pink', 'purple', 'light_gray', 'gray', 'cyan', 'brown', 'green', 'blue', 'red', 'black', 'yellow']
let wood_nomes = ['oak', 'spruce', 'birch', 'jungle', 'acacia', 'dark_oak', 'crimson', 'warped', 'mangrove', 'cherry', 'bamboo']
JEIEvents.hideItems(event => {
	let hide_metal = (mod, type) =>{
		event.hide(mod+':'+type+'_ingot')
		event.hide(mod+':'+type+'_nugget')
		event.hide(mod+':'+type+'_block')
	}
	hide_metal('tconstruct', 'steel')
	hide_metal('thermal', 'steel')
	hide_metal('thermal', 'tin')
	hide_metal('thermal', 'bronze')
  hide_metal('thermal', 'electrum')
	hide_metal('createdeco', 'cast_iron')
//	hide_metal('createbigcannons', 'cast_iron')
	hide_metal('davebuildingmod', 'steel')
	hide_metal('ad_astra', 'steel')
	hide_metal('tconstruct', 'steel')

	let hide_ores = (mod, type) =>{
		event.hide(mod+':'+type+'_ore')
		event.hide(mod+':'+'deepslate_'+type+'_ore')
		event.hide(mod+':'+'raw_'+type)
		event.hide(mod+':'+'raw_'+type+'_block')
		event.hide('create:crushed_raw_'+type)
	}
	hide_ores('thermal', 'tin')
	hide_ores('thermal', 'silver')
	hide_ores('occultism', 'silver')

  let hide_thermal_set = (type) => {
    event.hide('thermal:'+type+'_gear')
    event.hide('thermal:'+type+'_plate')
    event.hide('thermal:'+type+'_dust')
    }
  hide_thermal_set('tin')
  hide_thermal_set('bronze')
  hide_thermal_set('electrum')

	let encased = (type) => {
  event.hide(CC(`${type}_configurable_gearbox`))
	}
	encased("railway")
	encased("copper")
	encased("andesite")
	encased("brass")
	encased("industrial_iron")
	encased("weathered_iron")
	encased("refined_radiance")
	encased("shadow_steel")

	let creative = (type) => {
		event.hide(CC(`vertical_${type}_gearbox`))
		event.hide(CC(`${type}_encased_chain_drive`))
		event.hide(CC(`${type}_adjustable_chain_gearshift`))
		event.hide(CC(`${type}_casing`))
		event.hide(CC(`${type}_gearbox`))
		event.hide(CC(`${type}_cogwheel`))
		event.hide(CC(`${type}_configurable_gearbox`))
		event.hide(CC(`${type}_mixer`))
		event.hide(CC(`${type}_press`))
		event.hide(CC(`${type}_depot`))
		event.hide(CC(`${type}_chain_conveyor`))
		event.hide(CC(`${type}_gearshift`))
		event.hide(CC(`${type}_clutch`))
		event.hide(CC(`${type}_deployer`))
		event.hide(CC(`${type}_portable_storage_interface`))
		event.hide(CC(`${type}_encased_fan`))
		event.hide(CC(`${type}_mechanical_harvester`))
		event.hide(CC(`${type}_mechanical_saw`))
		event.hide(CC(`${type}_mechanical_drill`))
		event.hide(CC(`${type}_mechanical_plough`))
		event.hide(CC(`${type}_mechanical_roller`))
	}
  creative("creative")

  colors.forEach(color => {
		event.hide(AD(`small_${color}_industrial_lamp`))
		event.hide(AD(`${color}_industrial_lamp`))
		event.hide(AD(`${color}_flag`))
	});

	wood_nomes.forEach(type => {
		event.hide(CC(`${type}_shaft`))
		event.hide(CC(`${type}_cogwheel`))
		event.hide(CC(`${type}_large_cogwheel`))
	});

	let adastra = (item) => {
		event.hide(AD(`encased_${item}_block`))
		event.hide(AD(`${item}_plateblock`))
		event.hide(AD(`${item}_panel`))
		event.hide(AD(`${item}_plating`))
		event.hide(AD(`${item}_plating_stairs`))
		event.hide(AD(`${item}_plating_slab`))
		event.hide(AD(`${item}_pillar`))
		event.hide(AD(`glowing_${item}_pillar`))
		event.hide(AD(`${item}_plating_button`))
		event.hide(AD(`${item}_plating_pressure_plate`))
		event.hide(AD(`${item}_sliding_door`))
		event.hide(AD(`${item}_factory_block`))
		event.hide(AD(`${item}_block`))
		event.hide(AD(`raw_${item}_block`))
	}
	adastra('ostrum')
	adastra('calorite')
	adastra('etrium')

	event.hide('#forge:coins')

	event.hide('ae2:facade')
	event.hide('ae2:inscriber')
	event.hide('ae2:vibration_chamber')
	event.hide('ae2:quartz_growth_accelerator')

	event.hide('ad_astra:iron_plate')
	event.hide('ad_astra:compressed_steel')
	event.hide('ad_astra:engine_fan')
	event.hide('ad_astra:oxygen_tank')
	event.hide('ad_astra:iron_stick')
	event.hide('ad_astra:water_pump')
	event.hide('ad_astra:compressor')
	event.hide('ad_astra:coal_generator')
	event.hide('ad_astra:nasa_workbench')
	event.hide('ad_astra:fuel_refinery')
	event.hide('ad_astra:oxygen_gear')

	event.hide('biomesoplenty:rose_quartz_shard')

	event.hide('create:crushed_raw_silver')
	event.hide('createdeco:andesite_door')
	event.hide('createdeco:copper_door')
	event.hide('createdeco:brass_door')
	event.hide('createdeco:locked_andesite_door')
	event.hide('createdeco:locked_copper_door')
	event.hide('createdeco:locked_brass_door')
	event.hide('createdeco:zinc_coin')
	event.hide('createdeco:copper_coin')
	event.hide('createdeco:brass_coin')
	event.hide('createdeco:iron_coin')
	event.hide('createdeco:gold_coin')
	event.hide('createdeco:cast_iron_coin')
	event.hide('createdeco:netherite_coin')
	event.hide('createdeco:zinc_coinstack')
	event.hide('createdeco:copper_coinstack')
	event.hide('createdeco:brass_coinstack')
	event.hide('createdeco:iron_coinstack')
	event.hide('createdeco:gold_coinstack')
	event.hide('createdeco:cast_iron_coinstack')
	event.hide('createdeco:netherite_coinstack')

	event.hide('thermal:cinnabar_dust')
	event.hide('thermal:oil_sand')
	event.hide('thermal:oil_red_sand')
	event.hide('thermal:iron_plate')
	event.hide('thermal:copper_plate')
	event.hide('thermal:gold_plate')
	event.hide('thermal:netherite_plate')

	event.hide('createqol:trash_can')
	event.hide('createqol:inventory_linker')
	event.hide('createqol:brass_trash_can')
	event.hide('createqol:player_paper')
	event.hide('createqol:shadow_radiance_helmet')
	event.hide('createqol:shadow_radiance_chestplate')
	event.hide('createqol:shadow_radiance_leggings')
	event.hide('createqol:shadow_radiance_boots')
	event.hide(`createqol:refined_radiance_helmet`)
	event.hide(`createqol:refined_radiance_chestplate`)
	event.hide(`createqol:refined_radiance_leggings`)
	event.hide(`createqol:refined_radiance_boots`)
	event.hide(`createqol:shadow_steel_helmet`)
	event.hide(`createqol:shadow_steel_chestplate`)
	event.hide(`createqol:shadow_steel_leggings`)
	event.hide(`createqol:shadow_steel_boots`)
	event.hide(`createqol:shadow_steel_sword`)
	event.hide(`createqol:shadow_steel_pickaxe`)
	event.hide(`createqol:shadow_steel_axe`)
	event.hide(`createqol:shadow_steel_shovel`)
	event.hide(`createqol:shadow_steel_hoe`)
	event.hide(`createqol:shadow_radiance_sword`)
	event.hide(`createqol:shadow_radiance_pickaxe`)
	event.hide(`createqol:shadow_radiance_axe`)
	event.hide(`createqol:shadow_radiance_shovel`)
	event.hide(`createqol:shadow_radiance_hoe`)
	event.hide(`createqol:refined_radiance_sword`)
	event.hide(`createqol:refined_radiance_pickaxe`)
	event.hide(`createqol:refined_radiance_axe`)
	event.hide(`createqol:refined_radiance_shovel`)
	event.hide(`createqol:refined_radiance_hoe`)

  event.hide("kubejs:growing_rose_seed")
	event.hide("kubejs:growing_tiny_rose_crystal")
	event.hide("kubejs:growing_small_rose_crystal")
	event.hide("kubejs:incomplete_calculation_processor")
	event.hide("kubejs:incomplete_logic_processor")
	event.hide("kubejs:incomplete_engineering_processor")
	event.hide("kubejs:incomplete_rotation_mechanism")
	event.hide("kubejs:incomplete_pressure_mechanism")
	event.hide("kubejs:incomplete_logistic_mechanism")
	event.hide("kubejs:incomplete_train_mechanism")
	event.hide("kubejs:incomplete_scorch_mechanism")
	event.hide("kubejs:incomplete_power_mechanism")
	event.hide("kubejs:incomplete_explosive_mechanism")
	event.hide("kubejs:incomplete_ender_mechanism")
	event.hide("kubejs:incomplete_high_power_mechanism")
	event.hide("kubejs:incomplete_candy_mechanism")
	event.hide("kubejs:incomplete_steel_engine")
	event.hide("kubejs:incomplete_resistor")
	event.hide("kubejs:incomplete_inductor")
	event.hide("kubejs:incomplete_ceramic_capacitor")
	event.hide("kubejs:incomplete_electrolytic_capacitor")
	event.hide("kubejs:incomplete_rotation_machine")
	event.hide("kubejs:calculator")
	event.hide("kubejs:charged_calculator")

	event.hide ("sophisticatedbackpacks:void_upgrade")
	event.hide ("sophisticatedbackpacks:advanced_void_upgrade")
	event.hide ("sophisticatedstorage:advanced_void_upgrade")
	event.hide ("sophisticatedstorage:void_upgrade")

	event.hide("gearbox:mirror")
	event.hide("gearbox:laser_drill")
	event.hide("gearbox:chemical_reactor")
	event.hide("gearbox:dipper")
	event.hide("gearbox:tau_cannon")
	event.hide("gearbox:geld_ingot")
	event.hide('gearbox:compressor'),
  event.hide('gearbox:sapper'),
  event.hide('gearbox:resin'),
  event.hide('gearbox:resin_bucket'),

	event.hide('createaddition:diamond_grit')
	event.hide('createaddition:capacitor')
	event.hide('createaddition:zinc_sheet')

	event.hide('@trashcans')
	event.hide('@pipez')
	event.hide('@toms_storage')
	event.hide('@itemfilters')
	event.hide('@davebuildingmod')
	event.hide('@buddingcrystals')
	event.hide('@create_factory_logistics')
	event.hide('@trashcans')



})

JEIEvents.subtypes(event => {
	// event.useNBT('advancedrocketry:planet_id_chip')
})

JEIEvents.hideFluids(event => {
	event.hide('ad_astra:fuel')
	event.hide('tconstruct:molten_steel')
})

JEIEvents.addItems(event => {


	event.add('buddingcrystals:budding_budding_skystone')
	event.add('buddingcrystals:budding_skystone_cluster')
	event.add('pipez:fluid_pipe')
	event.add('pipez:energy_pipe')
	event.add('toms_storage:ts.crafting_terminal')
	event.add('toms_storage:ts.storage_terminal')
	event.add('toms_storage:ts.inventory_connector')
	event.add('toms_storage:ts.inventory_cable')
	event.add('toms_storage:ts.inventory_cable_connector')
	event.add('metalbarrels:wood_to_copper')
	event.add('metalbarrels:wood_to_iron')
	event.add('metalbarrels:wood_to_silver')
	event.add('metalbarrels:wood_to_gold')
	event.add('metalbarrels:wood_to_netherite')
	event.add('metalbarrels:copper_barrel')
	event.add('metalbarrels:iron_barrel')
	event.add('metalbarrels:silver_barrel')
	event.add('metalbarrels:gold_barrel')
	event.add('metalbarrels:netherite_barrel')
	event.add('thermal:apatite_ore')
	event.add('thermal:deepslate_apatite_ore')
	event.add('trashcans:item_trash_can')
	event.add('davebuildingmod:track_end')
	event.add('davebuildingmod:thomas_face')
	event.add('davebuildingmod:small_thomas_face')
	event.add('thermal:silver_coin')
	event.add('thermal:gold_coin')
})

JEIEvents.removeCategories(event => {
})

ItemEvents.tooltip(tooltip => {
	let main_assembly = (id, stage) => tooltip.add(id, [`§7Main Assembly: ${stage == "5" ? "§6Finale" : "§6Chapter " + stage}`, '§8Consider automating this item'])
	let bonus_assembly = (id, stage) => tooltip.add(id, [`§7Secondary Assembly: §6Chapter ${stage}`])
	let not_consumed = (id, stage) => tooltip.add(id, [`§7Not consumed in the`, `§7Assembly Process`])
	let ore = (id, y1, y2) => tooltip.add(id, [`§o§7Y level §6${y1} §7to §6${y2}`])


	// tooltip.add("minecraft:redstone_ore", [`§7Does not generate, crush Cinnabar to obtain Redstone.`]);

	ore("forbidden_arcanus:arcane_crystal_ore", 1, 9)
	ore("forbidden_arcanus:xpetrified_ore", 1, 30)
	// ore("ae2:quartz_ore", 1, 30)
	ore("thermal:apatite_ore", -16, 96)
	ore("thermal:deepslate_apatite_ore", -16, 96)

	ore("thermal:cinnabar_ore", -59, 10)
	ore("thermal:deepslate_cinnabar_ore", -59, 10)

	ore("thermal:niter_ore", -26, 20)
	ore("thermal:deepslate_niter_ore", -26, 20)

	ore("thermal:nickel_ore", -40, 20)
	ore("thermal:deepslate_nickel_ore", -40, 20)
	ore("thermal:lead_ore", -60, 10)
	ore("thermal:deepslate_lead_ore", -60, 10)
	ore("thermal:sulfur_ore", -16, 32)
	ore("thermal:deepslate_sulfur_ore", -16, 32)
	//ore("create:zinc_ore", 15, 70)
	//ore("create:copper_ore", 40, 85)

	//ore("minecraft:coal_ore", 1, 128)
	//ore("minecraft:iron_ore", 1, 64)
	//ore("minecraft:lapis_ore", 1, 32)
	//ore("minecraft:gold_ore", 1, 32)
	//ore("minecraft:diamond_ore", 1, 16)

	main_assembly('kubejs:rotation_mechanism', "1")
	bonus_assembly('kubejs:pressure_mechanism', "1A")
	bonus_assembly('kubejs:cardboard_mechanism', "1A")
	bonus_assembly('kubejs:train_mechanism', "1B")
	main_assembly('create:precision_mechanism', "2")
	bonus_assembly('kubejs:scorch_mechanism', "2A")
	bonus_assembly('kubejs:ender_mechanism', "3B")
	main_assembly('kubejs:explosive_mechanism', "3")
	bonus_assembly('kubejs:candy_mechanism', "2B")
	main_assembly('kubejs:power_mechanism', "4")
	bonus_assembly('kubejs:high_power_mechanism', "4A")
    main_assembly('gearbox:ultimate_mechanism', "5")


	not_consumed('farmersdelight:diamond_knife')
	// not_consumed('kubejs:stone_saw')
	// not_consumed('kubejs:iron_saw')
	// not_consumed('kubejs:diamond_saw')
	// not_consumed('create:super_glue')
	// not_consumed('xreliquary:mercy_cross')
	// not_consumed('xreliquary:ender_staff')

	// tooltip.add("structurescompass:structures_compass", [`§7Right-Click to Activate`]);

	tooltip.add("magicfeather:magicfeather", [`§6Grants Creative Flight`]);

	tooltip.add("kubejs:resistor", [`350kΩ`])
	tooltip.add("kubejs:electrolytic_capacitor", [`200V 470uF`])
	tooltip.add("kubejs:ceramic_capacitor", [`50V 0.1uF`])
	tooltip.add("kubejs:inductor", [`60uH`])

	tooltip.add("kubejs:candy_mechanism", [`Nourishment: 04:00`])

	// tooltip.add("xreliquary:alkahestry_tome", [`§6Cannot be used in Mechanical Crafting`]);

	tooltip.add("pipez:energy_pipe", [`§7Connections may have to be`, `§7marked as §fInputs §7by sneak-clicking`, `§7the connection with a §fWrench`]);
	tooltip.add("pipez:fluid_pipe", [`§7Connections may have to be`, `§7marked as §fInputs §7by sneak-clicking`, `§7the connection with a §fWrench`]);

	tooltip.add("kubejs:accellerator_redstone", ["§7When used in Alchemy Research:", "  §6One of the §ecorrect §6Reagents",
		"  §6in §eincorrect §6slots will not be consumed"]);
	tooltip.add("kubejs:accellerator_glowstone", ["§7When used in Alchemy Research:", "  §6One of the §ecorrect §6Reagents",
		"  §6in §ecorrect §6slots will not be consumed"]);

	// tooltip.add("thermal:machine_press", ["§eWarning: crash when viewing recipes."])

	tooltip.add("ae2:growth_accelerator", ["§erecipe by volit <3"])

	tooltip.add('buddingcrystals:budding_budding_skystone', ["§cwarning, this block cannot be broken after being placed, if it breaks, it will disappear"])


})

JEIEvents.information(event => {

})
