//priority: 4000

onEvent('item.registry', event => {

    // The texture for this item has to be placed in kubejs/assets/kubejs/textures/item/test_item.png
    // If you want a custom item model, you can create one in Blockbench and put it in kubejs/assets/kubejs/models/item/test_item.json

    event.create('stone_pebble').displayName('Stone Pebble')
    event.create('algal_blend').displayName('Algal Blend')
    event.create('algal_brick').displayName('Algal Brick')
	event.create('driftwood').displayName('Driftwood')
	event.create('drill_head').displayName('Drill Head')
	event.create('saw_blade').displayName('Saw Blade')

	event.create('kinetic_mechanism').displayName('Kinetic Mechanism')
	event.create('incomplete_kinetic_mechanism').type('create:sequenced_assembly').displayName('Incomplete Kinetic Mechanism')
	event.create('sealed_mechanism').displayName('Sealed Mechanism')
	event.create('incomplete_sealed_mechanism').type('create:sequenced_assembly').displayName('Incomplete Sealed Mechanism')
	event.create('inductive_mechanism').displayName('Inductive Mechanism').glow(true).rarity(RARITY_UNCOMMON)
	event.create('incomplete_inductive_mechanism').type('create:sequenced_assembly').displayName('Incomplete Inductive Mechanism')
	event.create('calculation_mechanism').displayName('Calculation Mechanism').glow(true).rarity(RARITY_RARE)
	event.create('incomplete_calculation_mechanism').type('create:sequenced_assembly').displayName('Incomplete Calculation Mechanism')
	event.create('abstruse_mechanism').displayName('Abstruse Mechanism').glow(true).rarity(RARITY_EPIC)
	event.create('incomplete_abstruse_mechanism').type('create:sequenced_assembly').displayName('Incomplete Abstruse Mechanism')
	// event.create('infernal_mechanism').displayName('Infernal Mechanism')
	// event.create('incomplete_infernal_mechanism').type('create:sequenced_assembly').displayName('Incomplete Infernal Mechanism')
	
	event.create('incomplete_steel_plate').type('create:sequenced_assembly').displayName('Incomplete Steel Plate')
	event.create('incomplete_desh_plate').type('create:sequenced_assembly').displayName('Incomplete Desh Plate')
	event.create('incomplete_silicon_plate').type('create:sequenced_assembly').displayName('Incomplete Silicon Plate')
	
	let crystalTypes = ['Nether', 'Certus', 'Fluix']
	crystalTypes.forEach(e => {
		let id = e.toLowerCase()
		event.create('growing_' + id + '_seed').type('create:sequenced_assembly').texture("appliedenergistics2:item/crystal_seed_" + id).displayName(e + ' Quartz Seed')
		event.create('tiny_' + id + '_crystal').texture("appliedenergistics2:item/crystal_seed_" + id + "2").displayName('Tiny ' + e + ' Quartz Crystal')
		event.create('growing_tiny_' + id + '_crystal').type('create:sequenced_assembly').texture("appliedenergistics2:item/crystal_seed_" + id + "2").displayName('Tiny ' + e + ' Quartz Crystal')
		event.create('small_' + id + '_crystal').texture("appliedenergistics2:item/crystal_seed_" + id + "3").displayName('Small ' + e + ' Quartz Crystal')
		event.create('growing_small_' + id + '_crystal').type('create:sequenced_assembly').texture("appliedenergistics2:item/crystal_seed_" + id + "3").displayName('Small ' + e + ' Quartz Crystal')
	});

	let processors = ["Calculation", "Logic", "Engineering"]
	processors.forEach(name => {
		let e = name.toLowerCase()
		event.create(`incomplete_${e}_processor`).type('create:sequenced_assembly').displayName(`Incomplete ${name} Processor`)
		event.create(`incomplete_${e}_processor_wafer`).type('create:sequenced_assembly').displayName(`Incomplete ${name} Processor Wafer`)
	})

	event.create('dye_entangled_singularity').unstackable().displayName('Chromatic Singularity')
	event.create('chromatic_resonator').displayName('Chromatic Resonator').maxDamage(512)
	event.create('radiant_coil').glow(true).displayName('Radiant Induction Coil').rarity(RARITY_UNCOMMON)
	event.create('radiant_sheet').glow(true).displayName('Radiant Sheet').rarity(RARITY_UNCOMMON)
	event.create('circuit_scrap').displayName('Circuit Scrap')
	event.create('missingno').texture("kubejs:item/missingno").displayName('∄')

	event
		.create('ultimate_salad')
		.glow(true)
		.rarity(RARITY_EPIC)
		.displayName('Ultimate Salad')
		.food(food => {
			food
				.removeEffect('poison')
				.effect('speed', 600, 0, 1)
				.effect('regeneration', 600, 1, 1)
				.effect('resistance', 6000, 1, 1)
				.effect('fire_resistance', 6000, 1, 1)
				.effect('absorption', 6000, 3, 1)
				.hunger(400)
				.saturation(0.5)
				.fastToEat()
		})



	//numbers
	let number = (name) => {
		let id = name.toLowerCase()
		event.create(id).glow(true).displayName(name)
	}

	number('Zero')
	number('One')
	number('Two')
	number('Three')
	number('Four')
	number('Five')
	number('Six')
	number('Seven')
	number('Eight')
	number('Nine')
	number('Plus')
	number('Minus')
	number('Multiply')
	number('Divide')
	event.create('three_cast').displayName('Integer Cast (3)').unstackable()
	event.create('eight_cast').displayName('Integer Cast (8)').unstackable()
	event.create('plus_cast').displayName('Operator Cast (+)').unstackable()
	event.create('minus_cast').displayName('Operator Cast (-)').unstackable()
	event.create('multiply_cast').displayName('Operator Cast (x)').unstackable()
	event.create('divide_cast').displayName('Operator Cast (/)').unstackable()
	event.create('computation_matrix').parentModel("kubejs:item/computation_matrix").displayName('Computation Matrix').rarity(RARITY_UNCOMMON).maxStackSize(16)



    event.create('1k_component_wafer').displayName('1k ME Storage Component Wafer')
    event.create('4k_component_wafer').displayName('4k ME Storage Component Wafer')
    event.create('16k_component_wafer').displayName('16k ME Storage Component Wafer')
    event.create('64k_component_wafer').displayName('64k ME Storage Component Wafer')

    event.create('256k_component_wafer').displayName('256k ME Storage Component Wafer')
    event.create('1m_component_wafer').displayName('1M ME Storage Component Wafer')
    event.create('4m_component_wafer').displayName('4M ME Storage Component Wafer')
    event.create('16m_component_wafer').displayName('16M ME Storage Component Wafer')

    event.create('silicon_press_wafer').displayName('Inscriber Silicon Press Wafer')
    event.create('calculation_processor_press_wafer').displayName('Inscriber Calculation Press Wafer')
    event.create('engineering_processor_press_wafer').displayName('Inscriber Engineering Press Wafer')
    event.create('logic_processor_press_wafer').displayName('Inscriber Logic Press Wafer')

    event.create('printed_silicon_wafer').displayName('Printed Silicon Wafer')
	event.create('printed_calculation_processor_wafer').displayName('Printed Calculation Circuit Wafer')
	event.create('printed_engineering_processor_wafer').displayName('Printed Engineering Circuit Wafer')
	event.create('printed_logic_processor_wafer').displayName('Printed Logic Circuit Wafer')

    event.create('calculation_processor_wafer').displayName('Calculation Processor Wafer')
    event.create('engineering_processor_wafer').displayName('Engineering Processor Wafer')
    event.create('logic_processor_wafer').displayName('Logic Processor Wafer')

    event.create('blank_upgrade').displayName('Blank Pipe Upgrade')

	event.create('unstable_screwdriver').displayName('Unstable Screwdriver').glow(true).rarity(RARITY_RARE).maxDamage(128000).texture("projectred-core:item/screwdriver")
	event.create('unstable_chromatic_resonator').displayName('Unstable Chromatic Resonator').glow(true).rarity(RARITY_RARE).maxDamage(512000).texture("kubejs:item/chromatic_resonator")
})