
package ru.dbotthepony.mc.otm.registry.game

import net.minecraft.core.component.DataComponents
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.tags.BlockTags
import net.minecraft.world.food.FoodProperties
import net.minecraft.world.item.ArmorItem
import net.minecraft.world.item.AxeItem
import net.minecraft.world.item.BlockItem
import net.minecraft.world.item.BucketItem
import net.minecraft.world.item.DoubleHighBlockItem
import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.HoeItem
import net.minecraft.world.item.Item
import net.minecraft.world.item.Item.Properties
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.PickaxeItem
import net.minecraft.world.item.Rarity
import net.minecraft.world.item.ShearsItem
import net.minecraft.world.item.ShieldItem
import net.minecraft.world.item.ShovelItem
import net.minecraft.world.item.SpawnEggItem
import net.minecraft.world.item.SwordItem
import net.minecraft.world.item.Tiers
import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.level.block.Block
import net.neoforged.bus.api.IEventBus
import net.neoforged.neoforge.common.SimpleTier
import ru.dbotthepony.mc.otm.capability.ITieredUpgradeSet
import ru.dbotthepony.mc.otm.capability.MatteryPlayer
import ru.dbotthepony.mc.otm.capability.UpgradeType
import ru.dbotthepony.mc.otm.config.CablesConfig
import ru.dbotthepony.mc.otm.config.ItemsConfig
import ru.dbotthepony.mc.otm.core.collect.SupplierList
import ru.dbotthepony.mc.otm.core.collect.SupplierMap
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.item.BatteryItem
import ru.dbotthepony.mc.otm.item.ChestUpgraderItem
import ru.dbotthepony.mc.otm.item.ConfiguratorItem
import ru.dbotthepony.mc.otm.item.CrudeBatteryItem
import ru.dbotthepony.mc.otm.item.EssenceServoItem
import ru.dbotthepony.mc.otm.item.FluidCapsuleItem
import ru.dbotthepony.mc.otm.item.block.FluidTankItem
import ru.dbotthepony.mc.otm.item.GravitationalDisruptorItem
import ru.dbotthepony.mc.otm.item.MatteryItem
import ru.dbotthepony.mc.otm.item.MinecartCargoCrateItem
import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem
import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem
import ru.dbotthepony.mc.otm.item.QuantumBatteryItem
import ru.dbotthepony.mc.otm.item.SimpleUpgrade
import ru.dbotthepony.mc.otm.item.ZPMItem
import ru.dbotthepony.mc.otm.item.addSimpleDescription
import ru.dbotthepony.mc.otm.item.armor.PortableGravitationStabilizerItem
import ru.dbotthepony.mc.otm.item.armor.TritaniumArmorItem
import ru.dbotthepony.mc.otm.item.block.EnergyCableItem
import ru.dbotthepony.mc.otm.item.consumables.*
import ru.dbotthepony.mc.otm.item.exopack.ExopackProbeItem
import ru.dbotthepony.mc.otm.item.exopack.ExopackSlotUpgradeItem
import ru.dbotthepony.mc.otm.item.exopack.ExopackUpgradeItem
import ru.dbotthepony.mc.otm.item.exopack.ProceduralExopackSlotUpgradeItem
import ru.dbotthepony.mc.otm.item.matter.CreativePatternItem
import ru.dbotthepony.mc.otm.item.matter.GoldDiskItem
import ru.dbotthepony.mc.otm.item.matter.MatterCapacitorItem
import ru.dbotthepony.mc.otm.item.matter.MatterDustItem
import ru.dbotthepony.mc.otm.item.matter.PatternStorageItem
import ru.dbotthepony.mc.otm.item.tool.ExplosiveHammerItem
import ru.dbotthepony.mc.otm.item.tool.MatteryAxeItem
import ru.dbotthepony.mc.otm.item.tool.RedstoneInteractorItem
import ru.dbotthepony.mc.otm.item.weapon.EnergySwordItem
import ru.dbotthepony.mc.otm.item.weapon.FallingSunItem
import ru.dbotthepony.mc.otm.item.weapon.WitheredSteelSwordItem
import ru.dbotthepony.mc.otm.registry.MDeferredRegister
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MNames
import ru.dbotthepony.mc.otm.registry.MRegistry
import java.util.Collections
import java.util.LinkedHashMap
import java.util.function.Supplier

object MItems {
	private val DEFAULT_PROPERTIES = Properties()
	private val registry = MDeferredRegister(BuiltInRegistries.ITEM)

	private fun register(name: String, blocks: Map<DyeColor?, Block>, properties: Properties = DEFAULT_PROPERTIES): Map<DyeColor?, BlockItem> {
		return registry.coloredWithBase(name) { color -> BlockItem(blocks[color]!!, properties) }
	}

	fun register(bus: IEventBus) {
		registry.register(bus)
	}

	val ENERGY_CABLES: Map<CablesConfig.E, BlockItem> = SupplierMap(CablesConfig.E.entries.map { conf ->
		conf to registry.register("${conf.name.lowercase()}_energy_cable") { EnergyCableItem(conf, DEFAULT_PROPERTIES) }
	})

	val ANDROID_STATION = register(MNames.ANDROID_STATION, MBlocks.ANDROID_STATION)
	val ANDROID_CHARGER = register(MNames.ANDROID_CHARGER, MBlocks.ANDROID_CHARGER)
	val BATTERY_BANK = register(MNames.BATTERY_BANK, MBlocks.BATTERY_BANK)
	val MATTER_DECOMPOSER = register(MNames.MATTER_DECOMPOSER, MBlocks.MATTER_DECOMPOSER)
	val MATTER_CAPACITOR_BANK = register(MNames.MATTER_CAPACITOR_BANK, MBlocks.MATTER_CAPACITOR_BANK)
	val MATTER_CABLE: BlockItem by registry.register(MNames.MATTER_CABLE) { BlockItem(MBlocks.MATTER_CABLE, DEFAULT_PROPERTIES) }
	val PATTERN_STORAGE: BlockItem by registry.register(MNames.PATTERN_STORAGE) { BlockItem(MBlocks.PATTERN_STORAGE, DEFAULT_PROPERTIES) }
	val MATTER_SCANNER = register(MNames.MATTER_SCANNER, MBlocks.MATTER_SCANNER)
	val MATTER_PANEL = register(MNames.MATTER_PANEL, MBlocks.MATTER_PANEL)
	val MATTER_REPLICATOR = register(MNames.MATTER_REPLICATOR, MBlocks.MATTER_REPLICATOR)
	val MATTER_BOTTLER = register(MNames.MATTER_BOTTLER, MBlocks.MATTER_BOTTLER)

	val TRITANIUM_ORE: BlockItem by registry.register(MNames.TRITANIUM_ORE) { BlockItem(MBlocks.TRITANIUM_ORE, DEFAULT_PROPERTIES) }
	val DEEPSLATE_TRITANIUM_ORE: BlockItem by registry.register(MNames.DEEPSLATE_TRITANIUM_ORE) { BlockItem(MBlocks.DEEPSLATE_TRITANIUM_ORE, DEFAULT_PROPERTIES) }
	val TRITANIUM_RAW_BLOCK: BlockItem by registry.register(MNames.TRITANIUM_RAW_BLOCK) { BlockItem(MBlocks.TRITANIUM_RAW_BLOCK, DEFAULT_PROPERTIES) }
	val ENERGY_COUNTER = register(MNames.ENERGY_COUNTER, MBlocks.ENERGY_COUNTER)
	val CHEMICAL_GENERATOR = register(MNames.CHEMICAL_GENERATOR, MBlocks.CHEMICAL_GENERATOR)
	val PLATE_PRESS = register(MNames.PLATE_PRESS, MBlocks.PLATE_PRESS)
	val TWIN_PLATE_PRESS = register(MNames.TWIN_PLATE_PRESS, MBlocks.TWIN_PLATE_PRESS)
	val MATTER_RECYCLER = register(MNames.MATTER_RECYCLER, MBlocks.MATTER_RECYCLER)

	val POWERED_FURNACE = register(MNames.POWERED_FURNACE, MBlocks.POWERED_FURNACE)
	val POWERED_BLAST_FURNACE = register(MNames.POWERED_BLAST_FURNACE, MBlocks.POWERED_BLAST_FURNACE)
	val POWERED_SMOKER = register(MNames.POWERED_SMOKER, MBlocks.POWERED_SMOKER)

	val STORAGE_BUS: BlockItem by registry.register(MNames.STORAGE_BUS) { BlockItem(MBlocks.STORAGE_BUS, DEFAULT_PROPERTIES) }
	val STORAGE_IMPORTER: BlockItem by registry.register(MNames.STORAGE_IMPORTER) { BlockItem(MBlocks.STORAGE_IMPORTER, DEFAULT_PROPERTIES) }
	val STORAGE_EXPORTER: BlockItem by registry.register(MNames.STORAGE_EXPORTER) { BlockItem(MBlocks.STORAGE_EXPORTER, DEFAULT_PROPERTIES) }
	val DRIVE_VIEWER = register(MNames.DRIVE_VIEWER, MBlocks.DRIVE_VIEWER)
	val DRIVE_RACK: BlockItem by registry.register(MNames.DRIVE_RACK) { BlockItem(MBlocks.DRIVE_RACK, DEFAULT_PROPERTIES) }
	val ITEM_MONITOR = register(MNames.ITEM_MONITOR, MBlocks.ITEM_MONITOR)
	val STORAGE_CABLE: BlockItem by registry.register(MNames.STORAGE_CABLE) { BlockItem(MBlocks.STORAGE_CABLE, DEFAULT_PROPERTIES) }
	val STORAGE_POWER_SUPPLIER = register(MNames.STORAGE_POWER_SUPPLIER, MBlocks.STORAGE_POWER_SUPPLIER)

	val GRILL = registry.coloredWithBase(MNames.GRILL) { BlockItem(MBlocks.GRILL[it]!!, DEFAULT_PROPERTIES) }

	val GRAVITATION_STABILIZER: BlockItem by registry.register(MNames.GRAVITATION_STABILIZER) { BlockItem(MBlocks.GRAVITATION_STABILIZER, DEFAULT_PROPERTIES) }

	val PHANTOM_ATTRACTOR: DoubleHighBlockItem by registry.register(MNames.PHANTOM_ATTRACTOR) { DoubleHighBlockItem(
		MBlocks.PHANTOM_ATTRACTOR, DEFAULT_PROPERTIES
	) }

	val ENERGY_SERVO = register(MNames.ENERGY_SERVO, MBlocks.ENERGY_SERVO)
	val COBBLESTONE_GENERATOR = register(MNames.COBBLESTONE_GENERATOR, MBlocks.COBBLESTONE_GENERATOR)

	val INFINITE_WATER_SOURCE: BlockItem by registry.register(MNames.INFINITE_WATER_SOURCE) { BlockItem(MBlocks.INFINITE_WATER_SOURCE, DEFAULT_PROPERTIES) }
	val ESSENCE_STORAGE = register(MNames.ESSENCE_STORAGE, MBlocks.ESSENCE_STORAGE)
	val MATTER_RECONSTRUCTOR = register(MNames.MATTER_RECONSTRUCTOR, MBlocks.MATTER_RECONSTRUCTOR)

	val FLYWHEEL_BATTERY by registry.register(MNames.FLYWHEEL_BATTERY) { BlockItem(MBlocks.FLYWHEEL_BATTERY, DEFAULT_PROPERTIES) }
	val FLYWHEEL_BEARING by registry.register(MNames.FLYWHEEL_BEARING) { BlockItem(MBlocks.FLYWHEEL_BEARING, DEFAULT_PROPERTIES) }
	val FLYWHEEL_SHAFT   by registry.register(MNames.FLYWHEEL_SHAFT)   { BlockItem(MBlocks.FLYWHEEL_SHAFT, DEFAULT_PROPERTIES) }
	val FLYWHEEL_HOUSING by registry.register(MNames.FLYWHEEL_HOUSING) { BlockItem(MBlocks.FLYWHEEL_HOUSING, DEFAULT_PROPERTIES) }

	val GENERATOR_BLOCK  by registry.register(MNames.GENERATOR_BLOCK)  { BlockItem(MBlocks.GENERATOR_BLOCK, DEFAULT_PROPERTIES) }
	val MODULAR_FRAME by registry.register(MNames.MODULAR_FRAME) { BlockItem(MBlocks.MODULAR_FRAME, DEFAULT_PROPERTIES) }
	val HEAVY_MODULAR_FRAME by registry.register(MNames.HEAVY_MODULAR_FRAME) { BlockItem(MBlocks.HEAVY_MODULAR_FRAME, DEFAULT_PROPERTIES) }

	val DEV_CHEST: BlockItem by registry.register(MNames.DEV_CHEST) { BlockItem(MBlocks.DEV_CHEST, DEFAULT_PROPERTIES) }
	val PAINTER: BlockItem by registry.register(MNames.PAINTER) { BlockItem(MBlocks.PAINTER, DEFAULT_PROPERTIES) }
	val MATTER_ENTANGLER: BlockItem by registry.register(MNames.MATTER_ENTANGLER) { BlockItem(MBlocks.MATTER_ENTANGLER, DEFAULT_PROPERTIES) }

	val TRITANIUM_HULL by registry.register(MNames.TRITANIUM_HULL) { BlockItem(MBlocks.TRITANIUM_HULL, DEFAULT_PROPERTIES) }
	val BLACK_HOLE_GENERATOR by registry.register(MNames.BLACK_HOLE_GENERATOR) { BlockItem(MBlocks.BLACK_HOLE_GENERATOR, DEFAULT_PROPERTIES) }
	val MATTER_INJECTOR by registry.register(MNames.MATTER_INJECTOR) { BlockItem(MBlocks.MATTER_INJECTOR, DEFAULT_PROPERTIES) }
	val ANTIMATTER_INJECTOR by registry.register(MNames.ANTIMATTER_INJECTOR) { BlockItem(MBlocks.ANTIMATTER_INJECTOR, DEFAULT_PROPERTIES) }

	val HIGH_ENERGY_PARTICLE_COLLECTOR by registry.register(MNames.HIGH_ENERGY_PARTICLE_COLLECTOR) { BlockItem(MBlocks.HIGH_ENERGY_PARTICLE_COLLECTOR, DEFAULT_PROPERTIES) }
	val ITEM_INPUT_HATCH by registry.register(MNames.ITEM_INPUT_HATCH) { BlockItem(MBlocks.ITEM_INPUT_HATCH, DEFAULT_PROPERTIES) }
	val ITEM_OUTPUT_HATCH by registry.register(MNames.ITEM_OUTPUT_HATCH) { BlockItem(MBlocks.ITEM_OUTPUT_HATCH, DEFAULT_PROPERTIES) }
	val ENERGY_INPUT_HATCH by registry.register(MNames.ENERGY_INPUT_HATCH) { BlockItem(MBlocks.ENERGY_INPUT_HATCH, DEFAULT_PROPERTIES) }
	val ENERGY_OUTPUT_HATCH by registry.register(MNames.ENERGY_OUTPUT_HATCH) { BlockItem(MBlocks.ENERGY_OUTPUT_HATCH, DEFAULT_PROPERTIES) }
	val MATTER_INPUT_HATCH by registry.register(MNames.MATTER_INPUT_HATCH) { BlockItem(MBlocks.MATTER_INPUT_HATCH, DEFAULT_PROPERTIES) }
	val MATTER_OUTPUT_HATCH by registry.register(MNames.MATTER_OUTPUT_HATCH) { BlockItem(MBlocks.MATTER_OUTPUT_HATCH, DEFAULT_PROPERTIES) }
	val ENERGY_INPUT_INTERFACE by registry.register(MNames.ENERGY_INPUT_INTERFACE) { BlockItem(MBlocks.ENERGY_INPUT_INTERFACE, DEFAULT_PROPERTIES) }
	val ENERGY_OUTPUT_INTERFACE by registry.register(MNames.ENERGY_OUTPUT_INTERFACE) { BlockItem(MBlocks.ENERGY_OUTPUT_INTERFACE, DEFAULT_PROPERTIES) }

	val MULTIBLOCK_TEST by registry.register("multiblock_test") { BlockItem(MBlocks.MULTIBLOCK_TEST, Properties().stacksTo(64)) }
	val TRITANIUM_ANVIL: Map<DyeColor?, List<BlockItem>>

	init {
		val map = LinkedHashMap<DyeColor?, List<BlockItem>>()

		for ((color, anvils) in MBlocks.TRITANIUM_ANVIL) {
			val props = ArrayList<Supplier<BlockItem>>()

			for (i in anvils.indices) {
				var name = MNames.TRITANIUM_ANVIL + i

				if (color != null)
					name += "_${color.name.lowercase()}"

				props.add(registry.register(name) { BlockItem(anvils[i], DEFAULT_PROPERTIES) })
			}

			map[color] = SupplierList(props)
		}

		TRITANIUM_ANVIL = Collections.unmodifiableMap(map)
	}

	object MachineUpgrades {
		object Basic : ITieredUpgradeSet {
			override val BLANK: Item by registry.register("blank_machine_upgrade_basic") { Item(DEFAULT_PROPERTIES) }

			override val SPEED: SimpleUpgrade by registry.register("speed_upgrade_basic") { SimpleUpgrade(Item.Properties(), UpgradeType.SPEED.set(), speedBonus = 0.125, failureMultiplier = 1.125, energyConsumed = Decimal.ONE_EIGHTH) }
			override val ENERGY_CONSUMPTION: SimpleUpgrade by registry.register("energy_consumption_upgrade_basic") { SimpleUpgrade(Item.Properties(), UpgradeType.ENERGY_CONSUMPTION.set(), speedBonus = -0.25, failureMultiplier = 1.125, energyConsumed = Decimal.MINUS_ONE_EIGHTH) }
			override val FAILSAFE: SimpleUpgrade by registry.register("failsafe_upgrade_basic") { SimpleUpgrade(Item.Properties(), UpgradeType.FAILSAFE.set(), speedBonus = -0.125, failureMultiplier = 0.75, energyConsumed = Decimal.ONE_EIGHTH) }

			override val ENERGY_STORAGE: SimpleUpgrade by registry.register("energy_storage_upgrade_basic") { SimpleUpgrade(Item.Properties(), UpgradeType.ENERGY_STORAGE.set(), energyStorage = Decimal.ONE_HALF) }
			override val MATTER_STORAGE: SimpleUpgrade by registry.register("matter_storage_upgrade_basic") { SimpleUpgrade(Item.Properties(), UpgradeType.MATTER_STORAGE.set(), matterStorage = Decimal.ONE_HALF) }

			override val PROCESSING_ITEMS: SimpleUpgrade by registry.register("processing_upgrade_basic") { SimpleUpgrade(Item.Properties(), UpgradeType.PROCESSING.set(), processingItems = 1, speedBonus = -0.25, failureMultiplier = 1.25, energyConsumed = Decimal.ONE_QUARTER) }
		}

		object Normal : ITieredUpgradeSet {
			override val BLANK: Item by registry.register("blank_machine_upgrade_normal") { Item(DEFAULT_PROPERTIES) }

			override val SPEED: SimpleUpgrade by registry.register("speed_upgrade_normal") { SimpleUpgrade(Item.Properties(), UpgradeType.SPEED.set(), speedBonus = 0.25, failureMultiplier = 1.25, energyConsumed = Decimal.ONE_QUARTER) }
			override val ENERGY_CONSUMPTION: SimpleUpgrade by registry.register("energy_consumption_upgrade_normal") { SimpleUpgrade(Item.Properties(), UpgradeType.ENERGY_CONSUMPTION.set(), speedBonus = -0.5, failureMultiplier = 1.25, energyConsumed = Decimal.MINUS_ONE_QUARTER) }
			override val FAILSAFE: SimpleUpgrade by registry.register("failsafe_upgrade_normal") { SimpleUpgrade(Item.Properties(), UpgradeType.FAILSAFE.set(), speedBonus = -0.25, failureMultiplier = 0.5, energyConsumed = Decimal.ONE_QUARTER) }

			override val ENERGY_STORAGE: SimpleUpgrade by registry.register("energy_storage_upgrade_normal") { SimpleUpgrade(Item.Properties(), UpgradeType.ENERGY_STORAGE.set(), energyStorage = Decimal.ONE) }
			override val MATTER_STORAGE: SimpleUpgrade by registry.register("matter_storage_upgrade_normal") { SimpleUpgrade(Item.Properties(), UpgradeType.MATTER_STORAGE.set(), matterStorage = Decimal.ONE) }

			override val PROCESSING_ITEMS: SimpleUpgrade by registry.register("processing_upgrade_normal") { SimpleUpgrade(Item.Properties(), UpgradeType.PROCESSING.set(), processingItems = 1, speedBonus = -0.125, failureMultiplier = 1.125, energyConsumed = Decimal.ONE_EIGHTH) }
		}

		object Advanced : ITieredUpgradeSet {
			override val BLANK: Item by registry.register("blank_machine_upgrade_advanced") { Item(DEFAULT_PROPERTIES) }

			override val SPEED: SimpleUpgrade by registry.register("speed_upgrade_advanced") { SimpleUpgrade(Item.Properties().rarity(Rarity.UNCOMMON), UpgradeType.SPEED.set(), speedBonus = 0.25, failureMultiplier = 1.125, energyConsumed = Decimal.ONE_EIGHTH) }
			override val ENERGY_CONSUMPTION: SimpleUpgrade by registry.register("energy_consumption_upgrade_advanced") { SimpleUpgrade(Item.Properties().rarity(Rarity.UNCOMMON), UpgradeType.ENERGY_CONSUMPTION.set(), speedBonus = -0.25, failureMultiplier = 1.125, energyConsumed = Decimal.MINUS_ONE_QUARTER) }
			override val FAILSAFE: SimpleUpgrade by registry.register("failsafe_upgrade_advanced") { SimpleUpgrade(Item.Properties().rarity(Rarity.UNCOMMON), UpgradeType.FAILSAFE.set(), speedBonus = -0.125, failureMultiplier = 0.5, energyConsumed = Decimal.ONE_EIGHTH) }

			override val ENERGY_STORAGE: SimpleUpgrade by registry.register("energy_storage_upgrade_advanced") { SimpleUpgrade(Item.Properties(), UpgradeType.ENERGY_STORAGE.set(), energyStorage = Decimal.TWO) }
			override val MATTER_STORAGE: SimpleUpgrade by registry.register("matter_storage_upgrade_advanced") { SimpleUpgrade(Item.Properties(), UpgradeType.MATTER_STORAGE.set(), matterStorage = Decimal.TWO) }

			override val PROCESSING_ITEMS: SimpleUpgrade by registry.register("processing_upgrade_advanced") { SimpleUpgrade(Item.Properties().rarity(Rarity.UNCOMMON), UpgradeType.PROCESSING.set(), processingItems = 2, speedBonus = -0.125, failureMultiplier = 1.125, energyConsumed = Decimal.ONE_EIGHTH) }
		}

		object Creative {
			val SPEED: SimpleUpgrade by registry.register("creative_speed_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.SPEED.set(), speedBonus = 1.0) }
			val ENERGY_CONSUMPTION: SimpleUpgrade by registry.register("creative_energy_consumption_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.ENERGY_CONSUMPTION.set(), energyConsumed = Decimal.MINUS_ONE) }
			val ENERGY_STORAGE: SimpleUpgrade by registry.register("creative_energy_storage_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.ENERGY_STORAGE.set(), energyStorage = Decimal.ONE) }
			val ENERGY_STORAGE_FLAT: SimpleUpgrade by registry.register("creative_energy_storage_flat_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.ENERGY_STORAGE.set(), energyStorageFlat = Decimal.LONG_MAX_VALUE) }
			val ENERGY_STORAGE_FLAT_SMALL: SimpleUpgrade by registry.register("creative_energy_storage_flat2_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.ENERGY_STORAGE.set(), energyStorageFlat = Decimal.INT_MAX_VALUE) }
			val ENERGY_THROUGHPUT: SimpleUpgrade by registry.register("creative_energy_throughput_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.ENERGY_THROUGHPUT.set(), energyThroughput = Decimal.ONE) }
			val ENERGY_THROUGHPUT_FLAT: SimpleUpgrade by registry.register("creative_energy_throughput_flat_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.ENERGY_THROUGHPUT.set(), energyThroughputFlat = Decimal.LONG_MAX_VALUE) }
			val ENERGY_THROUGHPUT_FLAT_SMALL: SimpleUpgrade by registry.register("creative_energy_throughput_flat2_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.ENERGY_THROUGHPUT.set(), energyThroughputFlat = Decimal.INT_MAX_VALUE) }
			val FAILSAFE: SimpleUpgrade by registry.register("creative_failsafe_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.FAILSAFE.set(), failureMultiplier = 0.0) }
			val FAILURE: SimpleUpgrade by registry.register("creative_failure_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.FAILSAFE.set(), failureMultiplier = 2.0) }
			val PROCESSING_ITEMS: SimpleUpgrade by registry.register("creative_processing_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.PROCESSING.set(), processingItems = 1) }

			val MATTER_STORAGE: SimpleUpgrade by registry.register("creative_matter_storage_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.MATTER_STORAGE.set(), matterStorage = Decimal.ONE) }
			val MATTER_STORAGE_FLAT: SimpleUpgrade by registry.register("creative_matter_storage_flat_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.MATTER_STORAGE.set(), matterStorageFlat = Decimal.LONG_MAX_VALUE) }
			val MATTER_STORAGE_FLAT_SMALL: SimpleUpgrade by registry.register("creative_matter_storage_flat2_upgrade") { SimpleUpgrade(Item.Properties().rarity(Rarity.EPIC), UpgradeType.MATTER_STORAGE.set(), matterStorageFlat = Decimal.INT_MAX_VALUE) }

			val LIST = SupplierList(
				Creative::SPEED,
				Creative::ENERGY_CONSUMPTION,
				Creative::ENERGY_STORAGE,
				Creative::ENERGY_STORAGE_FLAT,
				Creative::ENERGY_STORAGE_FLAT_SMALL,
				Creative::ENERGY_THROUGHPUT,
				Creative::ENERGY_THROUGHPUT_FLAT,
				Creative::ENERGY_THROUGHPUT_FLAT_SMALL,
				Creative::FAILSAFE,
				Creative::FAILURE,
				Creative::PROCESSING_ITEMS,
				Creative::MATTER_STORAGE,
				Creative::MATTER_STORAGE_FLAT,
				Creative::MATTER_STORAGE_FLAT_SMALL,
			)
		}

		init {
			Basic
			Normal
			Advanced
			Creative
		}

		val CRAFTABLE_TIERS = listOf(
			Basic,
			Normal,
			Advanced,
		)
	}

	init {
		MachineUpgrades
	}

	val MATTER_DUST: MatterDustItem by registry.register(MNames.MATTER_DUST) { MatterDustItem() }

	val TRITANIUM_ORE_CLUMP: Item by registry.register(MNames.TRITANIUM_ORE_CLUMP) { Item(DEFAULT_PROPERTIES) }
	val TRITANIUM_DUST: Item by registry.register(MNames.TRITANIUM_DUST) { Item(DEFAULT_PROPERTIES) }
	val TRITANIUM_NUGGET: Item by registry.register(MNames.TRITANIUM_NUGGET) { Item(DEFAULT_PROPERTIES) }
	val TRITANIUM_INGOT: Item by registry.register(MNames.TRITANIUM_INGOT) { Item(DEFAULT_PROPERTIES) }
	val TRITANIUM_INGOT_BLOCK: BlockItem by registry.register(MNames.TRITANIUM_INGOT_BLOCK) { BlockItem(MBlocks.TRITANIUM_INGOT_BLOCK, DEFAULT_PROPERTIES) }

	val WITHERED_STEEL_BLOCK: BlockItem by registry.register(MNames.WITHERED_STEEL_BLOCK) { BlockItem(MBlocks.WITHERED_STEEL_BLOCK, DEFAULT_PROPERTIES) }

	val TRITANIUM_BARS: BlockItem by registry.register(MNames.TRITANIUM_BARS) { BlockItem(MBlocks.TRITANIUM_BARS, DEFAULT_PROPERTIES) }
	val METAL_RAILING: BlockItem by registry.register(MNames.METAL_RAILING) { BlockItem(MBlocks.METAL_RAILING, DEFAULT_PROPERTIES) }

	val WITHERED_STEEL: Item by registry.register(MNames.WITHERED_STEEL) { Item(DEFAULT_PROPERTIES) }

	val DILITHIUM_CRYSTAL by registry.register("dilithium_crystal") { MatteryItem(DEFAULT_PROPERTIES) }
	val DILITHIUM_ORE by registry.register("dilithium_ore") { BlockItem(MBlocks.DILITHIUM_ORE, DEFAULT_PROPERTIES) }
	val DEEPSLATE_DILITHIUM_ORE by registry.register("deepslate_dilithium_ore") { BlockItem(MBlocks.DEEPSLATE_DILITHIUM_ORE, DEFAULT_PROPERTIES) }
	val DILITHIUM_CRYSTAL_BLOCK by registry.register("dilithium_crystal_block") { BlockItem(MBlocks.DILITHIUM_CRYSTAL_BLOCK, DEFAULT_PROPERTIES) }

	val REDSTONE_INTERACTOR: RedstoneInteractorItem by registry.register("redstone_interactor") { RedstoneInteractorItem() }

	val ESSENCE_SERVO: EssenceServoItem by registry.register("essence_servo") { EssenceServoItem() }
	val ESSENCE_CAPSULE: EssenceCapsuleItem by registry.register("essence_capsule") { EssenceCapsuleItem(false) }
	val ESSENCE_DRIVE: EssenceCapsuleItem by registry.register("essence_drive") { EssenceCapsuleItem(true) }

	val FLUID_CAPSULE: FluidCapsuleItem by registry.register("fluid_capsule") { FluidCapsuleItem(ItemsConfig::FLUID_CAPSULE_CAPACITY) }
	val FLUID_TANK: FluidTankItem by registry.register(MNames.FLUID_TANK) { FluidTankItem(MBlocks.FLUID_TANK, Properties().stacksTo(1), ItemsConfig::FLUID_TANK_CAPACITY) }
	val LIQUID_XP_BUCKET: BucketItem by registry.register("liquid_xp_bucket") { BucketItem(MFluids.LIQUID_XP, Item.Properties().stacksTo(1).rarity(Rarity.UNCOMMON)) }

	val TRITANIUM_COMPONENT: SimpleTier = SimpleTier(
		BlockTags.INCORRECT_FOR_IRON_TOOL,
		3072,
		Tiers.IRON.speed * 1.1f,
		3.5f,
		16,
	) { Ingredient.of(TRITANIUM_INGOT) }

	val TRITANIUM_SWORD: SwordItem by registry.register(MNames.TRITANIUM_SWORD) { SwordItem(
		TRITANIUM_COMPONENT,
		Properties().attributes(SwordItem.createAttributes(TRITANIUM_COMPONENT, 4f, -2.7f)))
	}

	val TRITANIUM_SHOVEL: ShovelItem by registry.register(MNames.TRITANIUM_SHOVEL) { ShovelItem(
		TRITANIUM_COMPONENT,
		Properties().attributes(ShovelItem.createAttributes(TRITANIUM_COMPONENT, 1.5f, -2.4f)))
	}

	val TRITANIUM_AXE: MatteryAxeItem by registry.register(MNames.TRITANIUM_AXE) { MatteryAxeItem(
		TRITANIUM_COMPONENT,
		Properties().attributes(AxeItem.createAttributes(TRITANIUM_COMPONENT, 8.5f, -3.4f)))
	}

	val TRITANIUM_PICKAXE: PickaxeItem by registry.register(MNames.TRITANIUM_PICKAXE) { PickaxeItem(
		TRITANIUM_COMPONENT,
		Properties().attributes(PickaxeItem.createAttributes(TRITANIUM_COMPONENT, 2f, -2.8f)))
	}

	val TRITANIUM_HOE: HoeItem by registry.register(MNames.TRITANIUM_HOE) { HoeItem(
		TRITANIUM_COMPONENT,
		Properties().attributes(ShovelItem.createAttributes(TRITANIUM_COMPONENT, 0f, -3.4f)))
	}

	val TRITANIUM_SHEARS: ShearsItem by registry.register(MNames.TRITANIUM_SHEARS) { object : ShearsItem(
		Properties().durability(3072).component(DataComponents.TOOL, createToolProperties())) {
		override fun isValidRepairItem(pToRepair: ItemStack, pRepair: ItemStack): Boolean {
			return pRepair.`is`(MItemTags.TRITANIUM_INGOTS)
		}
	} }

	val TRITANIUM_SHIELD: ShieldItem by registry.register(MNames.TRITANIUM_SHIELD) { object : ShieldItem(Properties().durability(2048)) {
		override fun isValidRepairItem(pToRepair: ItemStack, pRepair: ItemStack): Boolean {
			return pRepair.`is`(MItemTags.REINFORCED_TRITANIUM_PLATES)
		}
	} }

	val TRITANIUM_TOOLS = SupplierList(
		MItems::TRITANIUM_SWORD,
		MItems::TRITANIUM_SHOVEL,
		MItems::TRITANIUM_AXE,
		MItems::TRITANIUM_PICKAXE,
		MItems::TRITANIUM_HOE,
		MItems::TRITANIUM_SHEARS,
	)

	val TRITANIUM_HELMET: TritaniumArmorItem by registry.register(MNames.TRITANIUM_HELMET) { TritaniumArmorItem(ArmorItem.Type.HELMET) }
	val TRITANIUM_CHESTPLATE: TritaniumArmorItem by registry.register(MNames.TRITANIUM_CHESTPLATE) { TritaniumArmorItem(ArmorItem.Type.CHESTPLATE) }
	val TRITANIUM_PANTS: TritaniumArmorItem by registry.register(MNames.TRITANIUM_PANTS) { TritaniumArmorItem(ArmorItem.Type.LEGGINGS) }
	val TRITANIUM_BOOTS: TritaniumArmorItem by registry.register(MNames.TRITANIUM_BOOTS) { TritaniumArmorItem(ArmorItem.Type.BOOTS) }

	val SIMPLE_TRITANIUM_HELMET: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_HELMET) { ArmorItem(
		MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.HELMET, Properties().stacksTo(1).durability(ArmorItem.Type.HELMET.getDurability(24))) }
	val SIMPLE_TRITANIUM_CHESTPLATE: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_CHESTPLATE) { ArmorItem(
		MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.CHESTPLATE, Properties().stacksTo(1).durability(ArmorItem.Type.CHESTPLATE.getDurability(24))) }
	val SIMPLE_TRITANIUM_PANTS: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_PANTS) { ArmorItem(
		MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.LEGGINGS, Properties().stacksTo(1).durability(ArmorItem.Type.LEGGINGS.getDurability(24))) }
	val SIMPLE_TRITANIUM_BOOTS: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_BOOTS) { ArmorItem(
		MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.BOOTS, Properties().stacksTo(1).durability(ArmorItem.Type.BOOTS.getDurability(24))) }

	val TRITANIUM_ARMOR = SupplierList(
		MItems::TRITANIUM_HELMET,
		MItems::TRITANIUM_CHESTPLATE,
		MItems::TRITANIUM_PANTS,
		MItems::TRITANIUM_BOOTS
	)

	val SIMPLE_TRITANIUM_ARMOR = SupplierList(
		MItems::SIMPLE_TRITANIUM_HELMET,
		MItems::SIMPLE_TRITANIUM_CHESTPLATE,
		MItems::SIMPLE_TRITANIUM_PANTS,
		MItems::SIMPLE_TRITANIUM_BOOTS
	)

	val EXPLOSIVE_HAMMER: ExplosiveHammerItem by registry.register("explosive_hammer") { ExplosiveHammerItem() }

	val ENERGY_SWORD: Item by registry.register(MNames.ENERGY_SWORD) { EnergySwordItem() }
	val FALLING_SUN: Item by registry.register(MNames.FALLING_SUN) { FallingSunItem() }

	val WITHERED_STEEL_SWORD: Item by registry.register(MNames.WITHERED_STEEL_SWORD) { WitheredSteelSwordItem(Item.Properties().durability(420)) }

	val BLACK_HOLE_SCANNER: Item by registry.register(MNames.BLACK_HOLE_SCANNER) { MatteryItem(DEFAULT_PROPERTIES).addSimpleDescription().addSimpleDescription("2") }

	val GRAVITATION_FIELD_LIMITER: Item by registry.register(MNames.GRAVITATION_FIELD_LIMITER) { Item(DEFAULT_PROPERTIES) }
	val GRAVITATION_FIELD_SENSOR: Item by registry.register(MNames.GRAVITATION_FIELD_SENSOR) { Item(DEFAULT_PROPERTIES) }
	val PORTABLE_GRAVITATION_STABILIZER: Item by registry.register(MNames.PORTABLE_GRAVITATION_STABILIZER) { PortableGravitationStabilizerItem() }

	val BLACK_HOLE: Item by registry.register(MNames.BLACK_HOLE) { BlockItem(MBlocks.BLACK_HOLE, DEFAULT_PROPERTIES) }

	val GRAVITATIONAL_DISRUPTOR: Item by registry.register(MNames.GRAVITATIONAL_DISRUPTOR) { GravitationalDisruptorItem() }

	val PILL_ANDROID: Item by registry.register(MNames.PILL_ANDROID) { PillItem(PillType.BECOME_ANDROID) }
	val PILL_HUMANE: Item by registry.register(MNames.PILL_HUMANE) { PillItem(PillType.BECOME_HUMANE) }
	val PILL_OBLIVION: Item by registry.register(MNames.PILL_OBLIVION) { PillItem(PillType.OBLIVION) }
	val PILL_HEAL: Item by registry.register(MNames.PILL_HEAL) { HealPillItem() }
	val PILL_NOT_NORMAL: Item by registry.register(MNames.PILL_NOT_NORMAL) { NotNormalPill() }

	val IMPERFECT_BREAD: Item by registry.register(MNames.IMPERFECT_BREAD) { ImperfectBreadItem(Item.Properties().food(FoodProperties.Builder().nutrition(5).saturationModifier(0.6f).build())) }

	val PILLS = SupplierList(
		MItems::PILL_ANDROID,
		MItems::PILL_HUMANE,
		MItems::PILL_OBLIVION,
		MItems::PILL_HEAL,
		MItems::PILL_NOT_NORMAL,
	)

	val SUSPICIOUS_FOODS = SuspiciousFoods(registry)

	val BATTERY_CRUDE: Item by registry.register(MNames.BATTERY_CRUDE) { CrudeBatteryItem() }
	val BATTERY_BASIC: Item by registry.register(MNames.BATTERY_BASIC) { BatteryItem(ItemsConfig.Batteries.BASIC) }
	val BATTERY_NORMAL: Item by registry.register(MNames.BATTERY_NORMAL) { BatteryItem(ItemsConfig.Batteries.NORMAL) }
	val BATTERY_DENSE: Item by registry.register(MNames.BATTERY_DENSE) { BatteryItem(ItemsConfig.Batteries.DENSE) }
	val BATTERY_CAPACITOR: Item by registry.register(MNames.BATTERY_CAPACITOR) { BatteryItem(ItemsConfig.Batteries.CAPACITOR) }
	val BATTERY_CREATIVE: Item by registry.register(MNames.BATTERY_CREATIVE) { BatteryItem() }

	val QUANTUM_BATTERY: QuantumBatteryItem by registry.register(MNames.QUANTUM_BATTERY) { QuantumBatteryItem(MNames.QUANTUM_BATTERY, ItemsConfig.Batteries.QUANTUM_BATTERY) }
	val QUANTUM_CAPACITOR: QuantumBatteryItem by registry.register(MNames.QUANTUM_CAPACITOR) { QuantumBatteryItem(MNames.QUANTUM_CAPACITOR, ItemsConfig.Batteries.QUANTUM_CAPACITOR) }
	val QUANTUM_BATTERY_CREATIVE: QuantumBatteryItem by registry.register(MNames.QUANTUM_BATTERY_CREATIVE) { QuantumBatteryItem(
		MNames.QUANTUM_BATTERY_CREATIVE, null) }
	val ZPM_BATTERY: ZPMItem by registry.register(MNames.ZPM_BATTERY) { ZPMItem() }
	val PROCEDURAL_BATTERY: ProceduralBatteryItem by registry.register(MNames.PROCEDURAL_BATTERY) { ProceduralBatteryItem() }

	val BATTERIES = SupplierList(
		MItems::BATTERY_CRUDE,
		MItems::BATTERY_BASIC,
		MItems::BATTERY_NORMAL,
		MItems::BATTERY_DENSE,
		MItems::BATTERY_CAPACITOR,
	)

	val UNIQUE_BATTERIES = SupplierList(
		MItems::QUANTUM_BATTERY,
		MItems::QUANTUM_CAPACITOR,
		MItems::QUANTUM_BATTERY_CREATIVE,
		MItems::ZPM_BATTERY,
	)

	val ALL_BATTERIES = SupplierList(
		MItems::BATTERY_CRUDE,
		MItems::BATTERY_BASIC,
		MItems::BATTERY_NORMAL,
		MItems::BATTERY_DENSE,
		MItems::BATTERY_CAPACITOR,
		MItems::BATTERY_CREATIVE,

		MItems::QUANTUM_BATTERY,
		MItems::QUANTUM_CAPACITOR,
		MItems::QUANTUM_BATTERY_CREATIVE,
		MItems::ZPM_BATTERY,
	)

	val MATTER_CAPACITOR_BASIC: Item by registry.register(MNames.MATTER_CAPACITOR_BASIC) { MatterCapacitorItem(ItemsConfig.Capacitors::BASIC) }
	val MATTER_CAPACITOR_NORMAL: Item by registry.register(MNames.MATTER_CAPACITOR_NORMAL) { MatterCapacitorItem(ItemsConfig.Capacitors::NORMAL) }
	val MATTER_CAPACITOR_DENSE: Item by registry.register(MNames.MATTER_CAPACITOR_DENSE) { MatterCapacitorItem(ItemsConfig.Capacitors::DENSE) }
	val MATTER_CAPACITOR_CREATIVE: Item by registry.register(MNames.MATTER_CAPACITOR_CREATIVE) { MatterCapacitorItem() }

	val MATTER_CAPACITORS = SupplierList(
		MItems::MATTER_CAPACITOR_BASIC,
		MItems::MATTER_CAPACITOR_NORMAL,
		MItems::MATTER_CAPACITOR_DENSE,
		MItems::MATTER_CAPACITOR_CREATIVE,
	)

	val PATTERN_DRIVE_NORMAL: Item by registry.register(MNames.PATTERN_DRIVE_NORMAL) { PatternStorageItem(ItemsConfig.PatternDrives::NORMAL) }
	val PATTERN_DRIVE_DOUBLE: Item by registry.register(MNames.PATTERN_DRIVE_DOUBLE) { PatternStorageItem(ItemsConfig.PatternDrives::DOUBLE) }
	val PATTERN_DRIVE_TRIPLE: Item by registry.register(MNames.PATTERN_DRIVE_TRIPLE) { PatternStorageItem(ItemsConfig.PatternDrives::TRIPLE) }
	val PATTERN_DRIVE_QUAD: Item by registry.register(MNames.PATTERN_DRIVE_QUAD) { PatternStorageItem(ItemsConfig.PatternDrives::QUAD) }
	val PATTERN_DRIVE_CREATIVE: Item by registry.register(MNames.PATTERN_DRIVE_CREATIVE) { PatternStorageItem() }
	val PATTERN_DRIVE_CREATIVE2: Item by registry.register(MNames.PATTERN_DRIVE_CREATIVE2) { CreativePatternItem() }

	val GOLD_DISK: Item by registry.register("gold_disk") { GoldDiskItem(Properties().stacksTo(16).rarity(Rarity.RARE)) }

	val PORTABLE_CONDENSATION_DRIVE: Item by registry.register(MNames.PORTABLE_CONDENSATION_DRIVE) { PortableCondensationDriveItem(4000) }
	val PORTABLE_DENSE_CONDENSATION_DRIVE: Item by registry.register(MNames.PORTABLE_DENSE_CONDENSATION_DRIVE) { PortableCondensationDriveItem(25000) }

	val NUTRIENT_PASTE: Item by registry.register(MNames.NUTRIENT_PASTE) { Item(Properties().stacksTo(64).food(FoodProperties.Builder().nutrition(8).saturationModifier(0.9F).build())) }

	val REDSTONE_LAMP_INVERTED by registry.register(MNames.REDSTONE_LAMP_INVERTED) { BlockItem(MBlocks.REDSTONE_LAMP_INVERTED, DEFAULT_PROPERTIES) }
	val REINFORCED_REDSTONE_LAMP by registry.register(MNames.REINFORCED_REDSTONE_LAMP) { BlockItem(MBlocks.REINFORCED_REDSTONE_LAMP, DEFAULT_PROPERTIES) }
	val REINFORCED_REDSTONE_LAMP_INVERTED by registry.register(MNames.REINFORCED_REDSTONE_LAMP_INVERTED) { BlockItem(MBlocks.REINFORCED_REDSTONE_LAMP_INVERTED, DEFAULT_PROPERTIES) }

	val LABORATORY_LAMP: Item by registry.register(MNames.LABORATORY_LAMP) { BlockItem(MBlocks.LABORATORY_LAMP, DEFAULT_PROPERTIES) }
	val LABORATORY_LAMP_INVERTED: Item by registry.register(MNames.LABORATORY_LAMP_INVERTED) { BlockItem(MBlocks.LABORATORY_LAMP_INVERTED, DEFAULT_PROPERTIES) }
	val DANGER_STRIPE_BLOCK: Item by registry.register(MNames.DANGER_STRIPE_BLOCK) { BlockItem(MBlocks.DANGER_STRIPE_BLOCK, DEFAULT_PROPERTIES) }
	val METAL_BEAM: Item by registry.register(MNames.METAL_BEAM) { BlockItem(MBlocks.METAL_BEAM, DEFAULT_PROPERTIES) }
	val METAL_BEAM_CENTER: Item by registry.register(MNames.METAL_BEAM_CENTER) { BlockItem(MBlocks.METAL_BEAM_CENTER, DEFAULT_PROPERTIES) }
	val ENGINE: Item by registry.register(MNames.ENGINE) { BlockItem(MBlocks.ENGINE, DEFAULT_PROPERTIES) }
	val HOLO_SIGN: Item by registry.register(MNames.HOLO_SIGN) { BlockItem(MBlocks.HOLO_SIGN, DEFAULT_PROPERTIES) }

	val TRITANIUM_DOOR = register(MNames.TRITANIUM_DOOR, MBlocks.TRITANIUM_DOOR)
	val TRITANIUM_TRAPDOOR = register(MNames.TRITANIUM_TRAPDOOR, MBlocks.TRITANIUM_TRAPDOOR)

	// components
	val MATTER_IO_PORT: Item by registry.register(MNames.MATTER_IO_PORT) { Item(DEFAULT_PROPERTIES) }
	val MATTER_TRANSFORM_MATRIX: Item by registry.register("matter_transform_matrix") { MatteryItem(DEFAULT_PROPERTIES) }
	val ANTIMATTER_TRANSFORM_MATRIX: Item by registry.register("antimatter_transform_matrix") { MatteryItem(DEFAULT_PROPERTIES).addSimpleDescription() }
	val ENERGY_BUS: Item by registry.register(MNames.ENERGY_BUS) { Item(DEFAULT_PROPERTIES) }
	val ELECTRIC_PARTS: Item by registry.register("electric_parts") { MatteryItem(DEFAULT_PROPERTIES).addSimpleDescription() }
	val MECHANICAL_PARTS: Item by registry.register("mechanical_parts") { MatteryItem(DEFAULT_PROPERTIES).addSimpleDescription() }
	val MACHINE_FRAME: Item by registry.register(MNames.MACHINE_FRAME) { Item(DEFAULT_PROPERTIES) }
	val TRITANIUM_PLATE: Item by registry.register(MNames.TRITANIUM_PLATE) { Item(DEFAULT_PROPERTIES) }
	val IRON_PLATE: Item by registry.register(MNames.IRON_PLATE) { Item(DEFAULT_PROPERTIES) }
	val GOLD_PLATE: Item by registry.register(MNames.GOLD_PLATE) { Item(DEFAULT_PROPERTIES) }
	val COPPER_WIRING: Item by registry.register(MNames.COPPER_WIRING) { Item(DEFAULT_PROPERTIES) }
	val GOLD_WIRING: Item by registry.register(MNames.GOLD_WIRING) { Item(DEFAULT_PROPERTIES) }
	val PORTABLE_CONDENSATION_DRIVE_CASING: Item by registry.register(MNames.PORTABLE_CONDENSATION_DRIVE_CASING) { Item(
		DEFAULT_PROPERTIES
	) }
	val PORTABLE_DENSE_CONDENSATION_DRIVE_CASING: Item by registry.register(MNames.PORTABLE_DENSE_CONDENSATION_DRIVE_CASING) { Item(
		DEFAULT_PROPERTIES
	) }
	val CIRCUIT_PLATING: Item by registry.register(MNames.CIRCUIT_PLATING) { Item(DEFAULT_PROPERTIES) }
	val BASIC_CONTROL_CIRCUIT: Item by registry.register(MNames.BASIC_CONTROL_CIRCUIT) { Item(DEFAULT_PROPERTIES) }
	val ADVANCED_CONTROL_CIRCUIT: Item by registry.register(MNames.ADVANCED_CONTROL_CIRCUIT) { Item(DEFAULT_PROPERTIES) }
	val MATTER_CAPACITOR_PARTS: Item by registry.register(MNames.MATTER_CAPACITOR_PARTS) { Item(DEFAULT_PROPERTIES) }
	val CARBON_MESH: Item by registry.register(MNames.CARBON_MESH) { Item(DEFAULT_PROPERTIES) }
	val ARMOR_ASSEMBLY: Item by registry.register(MNames.ARMOR_ASSEMBLY) { Item(DEFAULT_PROPERTIES) }
	val REINFORCED_TRITANIUM_PLATE: Item by registry.register(MNames.REINFORCED_TRITANIUM_PLATE) { MatteryItem(
		DEFAULT_PROPERTIES
	).addSimpleDescription() }
	val REINFORCED_IRON_PLATE: Item by registry.register(MNames.REINFORCED_IRON_PLATE) { MatteryItem(
		DEFAULT_PROPERTIES
	).addSimpleDescription() }

	val QUANTUM_TRANSCEIVER: Item by registry.register(MNames.QUANTUM_TRANSCEIVER) { Item(DEFAULT_PROPERTIES) }
	val ELECTROMAGNET: Item by registry.register(MNames.ELECTROMAGNET) { Item(DEFAULT_PROPERTIES) }
	val ELECTROMOTOR: Item by registry.register(MNames.ELECTROMOTOR) { Item(DEFAULT_PROPERTIES) }
	val MIRROR_COMPOUND: Item by registry.register(MNames.MIRROR_COMPOUND) { Item(DEFAULT_PROPERTIES) }
	val MIRROR: Item by registry.register(MNames.MIRROR) { MatteryItem(DEFAULT_PROPERTIES).addSimpleDescription() }
	val DISPLAY_SCREEN: Item by registry.register(MNames.DISPLAY_SCREEN) { Item(DEFAULT_PROPERTIES) }

	/**
	 * List of components for everything else
	 */
	val COMPONENTS = SupplierList(
		MItems::MATTER_IO_PORT,
		MItems::MATTER_TRANSFORM_MATRIX,
		MItems::ANTIMATTER_TRANSFORM_MATRIX,
		MItems::ENERGY_BUS,
		MItems::ELECTRIC_PARTS,
		MItems::MECHANICAL_PARTS,
		MItems::MACHINE_FRAME,
		MItems::TRITANIUM_PLATE,
		MItems::IRON_PLATE,
		MItems::GOLD_PLATE,
		MItems::COPPER_WIRING,
		MItems::GOLD_WIRING,
		MItems::PORTABLE_CONDENSATION_DRIVE_CASING,
		MItems::PORTABLE_DENSE_CONDENSATION_DRIVE_CASING,
		MItems::CIRCUIT_PLATING,
		MItems::BASIC_CONTROL_CIRCUIT,
		MItems::ADVANCED_CONTROL_CIRCUIT,
		MItems::MATTER_CAPACITOR_PARTS,

		MItems::QUANTUM_TRANSCEIVER,
		MItems::ELECTROMAGNET,
		MItems::ELECTROMOTOR,
		MItems::MIRROR_COMPOUND,
		MItems::MIRROR,
		MItems::DISPLAY_SCREEN,

		MItems::CARBON_MESH,
		MItems::ARMOR_ASSEMBLY,
		MItems::REINFORCED_TRITANIUM_PLATE,
		MItems::REINFORCED_IRON_PLATE,

		MachineUpgrades.Basic::BLANK,
		MachineUpgrades.Normal::BLANK,
		MachineUpgrades.Advanced::BLANK,
	)

	/**
	 * List of components for datagen code
	 */
	val DATAGEN_COMPONENTS = SupplierList(
		MItems::ENERGY_BUS,
		MItems::ELECTRIC_PARTS,
		MItems::MECHANICAL_PARTS,
		MItems::TRITANIUM_PLATE,
		MItems::IRON_PLATE,
		MItems::GOLD_PLATE,
		MItems::COPPER_WIRING,
		MItems::GOLD_WIRING,
		MItems::CIRCUIT_PLATING,
		MItems::BASIC_CONTROL_CIRCUIT,
		MItems::ADVANCED_CONTROL_CIRCUIT,
		MItems::MATTER_CAPACITOR_PARTS,
		MItems::MATTER_IO_PORT,
		MItems::MATTER_TRANSFORM_MATRIX,
		MItems::ANTIMATTER_TRANSFORM_MATRIX,
		MItems::QUANTUM_TRANSCEIVER,
		MItems::ELECTROMAGNET,
		MItems::ELECTROMOTOR,
		MItems::MIRROR_COMPOUND,
		MItems::MIRROR,
		MItems::DISPLAY_SCREEN,

		MItems::CARBON_MESH,
		MItems::ARMOR_ASSEMBLY,
		MItems::REINFORCED_TRITANIUM_PLATE,
		MItems::REINFORCED_IRON_PLATE,
	)

	val CARGO_CRATE_MINECARTS = registry.coloredWithBase(MNames.MINECART_CARGO_CRATE, ::MinecartCargoCrateItem)

	val EXOPACK_PROBE: Item by registry.register(MNames.EXOPACK_PROBE, ::ExopackProbeItem)

	object ExopackUpgrades {
		val INVENTORY_UPGRADE_CREATIVE: ExopackSlotUpgradeItem by registry.register("exosuit_inventory_upgrade_creative") { ExopackSlotUpgradeItem(null, 27, Rarity.EPIC) }
		val CRAFTING_UPGRADE: ExopackUpgradeItem by registry.register("exosuit_crafting_upgrade") { ExopackUpgradeItem(MatteryPlayer.UpgradeType.CRAFTING, "crafting_upgrade", "crafting_upgraded") }
		val SMELTING_UPGRADE: ExopackUpgradeItem by registry.register("exopack_smelting_upgrade") { ExopackUpgradeItem(MatteryPlayer.UpgradeType.SMELTING, "smelting_upgrade", "smelting_installed") }
		val ENDER_UPGRADE: ExopackUpgradeItem by registry.register("exopack_ender_upgrade") { ExopackUpgradeItem(MatteryPlayer.UpgradeType.ENDER_ACCESS, "ender_access_upgrade", "ender_access_installed") }

		val INVENTORY_UPGRADES = SupplierList(8) {
			registry.register("exosuit_inventory_upgrade_$it") { ExopackSlotUpgradeItem(18, Rarity.COMMON) }
		}

		val INVENTORY_UPGRADE_PROCEDURAL: ProceduralExopackSlotUpgradeItem by registry.register("exosuit_inventory_upgrade_procedural") { ProceduralExopackSlotUpgradeItem() }

		val INVENTORY_UPGRADE_BIG: ExopackSlotUpgradeItem by registry.register("exosuit_inventory_upgrade_big") { ExopackSlotUpgradeItem(60, Rarity.RARE) }
		val INVENTORY_UPGRADE_HUGE: ExopackSlotUpgradeItem by registry.register("exosuit_inventory_upgrade_huge") { ExopackSlotUpgradeItem(135, Rarity.RARE) }

		val INVENTORY_UPGRADE_WITHER: ExopackSlotUpgradeItem by registry.register("exosuit_inventory_upgrade_wither") { ExopackSlotUpgradeItem(180, Rarity.RARE, hasDescription = true) }
		val INVENTORY_UPGRADE_ENDER_DRAGON: ExopackSlotUpgradeItem by registry.register("exosuit_inventory_upgrade_ender_dragon") { ExopackSlotUpgradeItem(180, Rarity.EPIC, hasDescription = true) }
	}

	init {
		// call static initializer
		ExopackUpgrades
	}

	val TRITANIUM_STRIPED_BLOCK = registry.colored(MNames.TRITANIUM_STRIPED_BLOCK) { BlockItem(MBlocks.TRITANIUM_STRIPED_BLOCK[it]!!, DEFAULT_PROPERTIES) }
	val TRITANIUM_STRIPED_STAIRS = registry.colored(MNames.TRITANIUM_STRIPED_STAIRS) { BlockItem(MBlocks.TRITANIUM_STRIPED_STAIRS[it]!!, DEFAULT_PROPERTIES) }
	val TRITANIUM_STRIPED_SLAB = registry.colored(MNames.TRITANIUM_STRIPED_SLAB) { BlockItem(MBlocks.TRITANIUM_STRIPED_SLAB[it]!!, DEFAULT_PROPERTIES) }
	val TRITANIUM_STRIPED_WALL = registry.colored(MNames.TRITANIUM_STRIPED_WALL) { BlockItem(MBlocks.TRITANIUM_STRIPED_WALL[it]!!, DEFAULT_PROPERTIES) }
	val CARBON_FIBRE_BLOCK: Item by registry.register(MNames.CARBON_FIBRE_BLOCK) { BlockItem(MBlocks.CARBON_FIBRE_BLOCK, DEFAULT_PROPERTIES) }
	val METAL_JUNK: Item by registry.register(MNames.METAL_JUNK) { BlockItem(MBlocks.METAL_JUNK, DEFAULT_PROPERTIES) }
	val METAL_MESH: Item by registry.register(MNames.METAL_MESH) { BlockItem(MBlocks.METAL_MESH, DEFAULT_PROPERTIES) }

	val CHEST_UPGRADER: Item by registry.register(MNames.CHEST_UPGRADER) { ChestUpgraderItem() }

	val BREAD_MONSTER_SPAWN_EGG: Item by registry.register(MNames.BREAD_MONSTER_SPAWN_EGG){ SpawnEggItem(MEntityTypes.BREAD_MONSTER, 0xFFFFFF, 0xFFFFFF, Item.Properties())}
	val LOADER_SPAWN_EGG: Item by registry.register(MNames.LOADER_SPAWN_EGG){ SpawnEggItem(MEntityTypes.LOADER, 0xFFFFFF, 0xFFFFFF, Item.Properties())}

	val ROFLITE_ALLOY_INGOT: Item by registry.register(MNames.ROFLITE_ALLOY_INGOT) { Item(DEFAULT_PROPERTIES) }
	val ROFLITE_ALLOY_BLOCK: BlockItem by registry.register(MNames.ROFLITE_ALLOY_BLOCK) { BlockItem(MBlocks.ROFLITE_ALLOY_BLOCK, DEFAULT_PROPERTIES) }

	val CONFIGURATOR: Item by registry.register(MNames.CONFIGURATOR) { ConfiguratorItem() }

	init {
		MRegistry.registerItems(registry)
	}
}
