package ru.dbotthepony.mc.otm.datagen.recipes

import net.minecraft.data.recipes.FinishedRecipe
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.ShapelessRecipeBuilder
import net.minecraft.tags.ItemTags
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient
import net.minecraftforge.common.Tags
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.registry.MBlocks
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.ExplosiveHammerPrimingRecipe
import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe
import java.util.function.Consumer

fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
	val machinesCategory = RecipeCategory.DECORATIONS

	MatteryRecipe(MRegistry.CARGO_CRATES.item, category = RecipeCategory.DECORATIONS)
		.row(MItemTags.TRITANIUM_PLATES, Tags.Items.CHESTS, MItemTags.TRITANIUM_PLATES)
		.unlockedBy(MItemTags.TRITANIUM_PLATES)
		.unlockedBy(Tags.Items.CHESTS)
		.build(consumer)

	for ((dye, crate) in MRegistry.CARGO_CRATES.blocks) {
		ShapelessRecipeBuilder(RecipeCategory.DECORATIONS, crate, 1)
			.requires(Ingredient.of(MRegistry.CARGO_CRATES.allItems.entries.stream().filter { it.key != dye }.map { ItemStack(it.value) }))
			.requires(dye.tag)
			.unlockedBy(MRegistry.CARGO_CRATES.allItems.entries.stream().filter { it.key != dye }.map { it.value })
			.save(consumer, "${crate.registryName}_alt")
	}

	ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.TRITANIUM_INGOT_BLOCK, 1)
		.requires(Ingredient.of(MItemTags.TRITANIUM_INGOTS), 9)
		.unlockedBy(MItemTags.TRITANIUM_INGOTS)
		.save(consumer)

	ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 9)
		.requires(Ingredient.of(MItemTags.TRITANIUM_INGOTS_STORAGE))
		.unlockedBy(MItemTags.TRITANIUM_INGOTS_STORAGE)
		.save(consumer, modLocation("tritanium_ingot_from_storage"))

	ShapelessRecipeBuilder(machinesCategory, MItems.ENERGY_COUNTER, 1)
		.requires(MItems.ENERGY_COUNTER)
		.unlockedBy(MItems.ENERGY_COUNTER)
		.save(consumer, modLocation("energy_counter_reset"))

	ShapelessRecipeBuilder(machinesCategory, MItems.HOLO_SIGN, 1)
		.requires(MItems.HOLO_SIGN)
		.unlockedBy(MItems.HOLO_SIGN)
		.save(consumer, modLocation("holo_sign_reset"))

	MatteryRecipe(MBlocks.PLATE_PRESS, category = machinesCategory)
		.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS)
		.row(MItemTags.TRITANIUM_INGOTS, Items.BLAST_FURNACE, MItemTags.TRITANIUM_INGOTS)
		.row(MItemTags.PISTONS, MItemTags.TRITANIUM_INGOTS, MItemTags.PISTONS)
		.unlockedBy(MItemTags.TRITANIUM_INGOTS)
		.unlockedBy(MItems.ELECTRIC_PARTS)
		.build(consumer)

	MatteryRecipe(MBlocks.PLATE_PRESS, category = machinesCategory)
		.rowB(MItemTags.PISTONS)
		.rowB(MItems.MACHINE_FRAME)
		.unlockedBy(MItemTags.TRITANIUM_INGOTS)
		.unlockedBy(MItems.ELECTRIC_PARTS)
		.build(consumer, "advanced")

	MatteryRecipe(MBlocks.TWIN_PLATE_PRESS, category = machinesCategory)
		.rowB(MItemTags.PISTONS)
		.rowB(MItems.PLATE_PRESS)
		.rowB(MItemTags.TRITANIUM_PLATES)
		.unlockedBy(MItems.PLATE_PRESS)
		.build(consumer)

	MatteryRecipe(MItems.PATTERN_DRIVE_NORMAL, category = machinesCategory)
		.rowAC(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
		.row(MItemTags.ADVANCED_CIRCUIT, MItemTags.TRITANIUM_PLATES, MItemTags.ADVANCED_CIRCUIT)
		.rowAC(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
		.unlockedBy(MItemTags.ADVANCED_CIRCUIT)
		.build(consumer)

	// Машины
	MatteryRecipe(MItems.MATTER_RECYCLER, category = machinesCategory)
		.row(MItems.MATTER_CAPACITOR_PARTS, Items.HOPPER, MItemTags.BASIC_CIRCUIT)
		.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
		.row(MItems.MATTER_CABLE, MItems.MATTER_IO_PORT, MItems.MATTER_CABLE)
		.unlockedBy(MItems.MATTER_CABLE)
		.build(consumer)

	// Блоки
	MatteryRecipe(MItems.MATTER_CAPACITOR_BANK, category = machinesCategory)
		.row(Tags.Items.GLASS, MItemTags.IRON_PLATES, Tags.Items.GLASS)
		.row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES)
		.row(MItems.MATTER_CABLE, MItems.MATTER_IO_PORT, MItems.MATTER_CABLE)
		.unlockedBy(MItems.MATTER_CABLE)
		.build(consumer)

	MatteryRecipe(MItems.BATTERY_BANK, category = machinesCategory)
		.row(Tags.Items.GLASS, MItemTags.IRON_PLATES, Tags.Items.GLASS)
		.row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES)
		.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS)
		.unlockedBy(MItems.ENERGY_BUS)
		.build(consumer)

	MatteryRecipe(MItems.GRAVITATION_STABILIZER, category = machinesCategory)
		.row(MItemTags.ADVANCED_CIRCUIT, MItems.GRAVITATION_FIELD_SENSOR, MItemTags.ADVANCED_CIRCUIT)
		.row(MItems.MATTER_TRANSFORM_MATRIX, MItems.MACHINE_FRAME, MItems.MATTER_TRANSFORM_MATRIX)
		.row(MItemTags.TRITANIUM_PLATES, MItems.GRAVITATION_FIELD_LIMITER, MItemTags.TRITANIUM_PLATES)
		.unlockedBy(MItems.GRAVITATION_FIELD_LIMITER)
		.unlockedBy(MItems.GRAVITATION_FIELD_SENSOR)
		.build(consumer)

	MatteryRecipe(MItems.PORTABLE_GRAVITATION_STABILIZER, category = RecipeCategory.COMBAT)
		.rowB(MItemTags.TRITANIUM_PLATES)
		.row(MItemTags.TRITANIUM_PLATES, MItems.GRAVITATION_FIELD_SENSOR, MItemTags.TRITANIUM_PLATES)
		.row(MItemTags.TRITANIUM_PLATES, MItems.GRAVITATION_FIELD_LIMITER, MItemTags.TRITANIUM_PLATES)
		.unlockedBy(MItems.GRAVITATION_FIELD_LIMITER)
		.unlockedBy(MItems.GRAVITATION_FIELD_SENSOR)
		.build(consumer)

	MatteryRecipe(MItems.GRAVITATION_FIELD_SENSOR, category = RecipeCategory.MISC)
		.rowB(MItemTags.BASIC_CIRCUIT)
		.row(MItemTags.TRITANIUM_PLATES, MItems.ELECTROMAGNET, MItemTags.TRITANIUM_PLATES)
		.rowB(MItemTags.IRON_PLATES)
		.unlockedBy(MItems.ELECTROMAGNET)
		.build(consumer)

	MatteryRecipe(MItems.GRAVITATION_FIELD_LIMITER, category = RecipeCategory.MISC)
		.row(Tags.Items.ENDER_PEARLS, MItemTags.ADVANCED_CIRCUIT, Tags.Items.ENDER_PEARLS)
		.row(MItemTags.GOLD_WIRES, MItems.QUANTUM_TRANSCEIVER, MItemTags.GOLD_WIRES)
		.rowB(MItemTags.TRITANIUM_PLATES)
		.unlockedBy(MItems.QUANTUM_TRANSCEIVER)
		.build(consumer)

	MatteryRecipe(MItems.BLACK_HOLE_SCANNER, category = RecipeCategory.TOOLS)
		.row(MItemTags.IRON_PLATES, Tags.Items.GLASS_PANES_COLORLESS, MItemTags.IRON_PLATES)
		.row(MItemTags.GOLD_WIRES, MItems.GRAVITATION_FIELD_SENSOR, MItemTags.ADVANCED_CIRCUIT)
		.rowAC(Tags.Items.DUSTS_GLOWSTONE, MItemTags.TRITANIUM_PLATES)
		.unlockedBy(MItems.GRAVITATION_FIELD_SENSOR)
		.build(consumer)

	MatteryRecipe(MItems.PHANTOM_ATTRACTOR, category = machinesCategory)
		.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.GLASS_COLORLESS, Tags.Items.DUSTS_REDSTONE)
		.row(MItemTags.TRITANIUM_PLATES, MItems.QUANTUM_TRANSCEIVER, MItemTags.TRITANIUM_PLATES)
		.row(MItemTags.TRITANIUM_PLATES, ItemTags.BEDS, MItemTags.TRITANIUM_PLATES)
		.unlockedBy(MItems.QUANTUM_TRANSCEIVER)
		.build(consumer)

	MatteryRecipe(MItems.QUANTUM_TRANSCEIVER, 2, category = RecipeCategory.MISC)
		.rowAC(MItemTags.COPPER_WIRES, MItemTags.COPPER_WIRES)
		.row(MItemTags.GOLD_WIRES, Tags.Items.ENDER_PEARLS, MItemTags.GOLD_WIRES)
		.row(MItemTags.GOLD_WIRES, MItems.ELECTROMAGNET, MItemTags.GOLD_WIRES)
		.unlockedBy(Tags.Items.ENDER_PEARLS)
		.build(consumer)

	MatteryRecipe(MItems.ELECTROMAGNET, category = RecipeCategory.MISC)
		.row(MItemTags.COPPER_WIRES, Tags.Items.INGOTS_IRON, MItemTags.COPPER_WIRES)
		.unlockedBy(Tags.Items.ENDER_PEARLS)
		.build(consumer)

	MatteryRecipe(MItems.ENERGY_SERVO, category = RecipeCategory.MISC)
		.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
		.row(MItemTags.TRITANIUM_PLATES, MItems.ENERGY_BUS, MItemTags.TRITANIUM_PLATES)
		.unlockedBy(MItems.ENERGY_BUS)
		.build(consumer)

	MatteryRecipe(MItems.MIRROR_COMPOUND, 3, category = RecipeCategory.MISC)
		.row(Tags.Items.GLASS_PANES_COLORLESS, Tags.Items.GLASS_PANES_COLORLESS, Tags.Items.GLASS_PANES_COLORLESS)
		.row(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES, MItemTags.IRON_PLATES)
		.unlockedBy(MItemTags.IRON_PLATES)
		.unlockedBy(Tags.Items.GLASS_PANES_COLORLESS)
		.build(consumer)

	MatteryRecipe(MItems.REINFORCED_TRITANIUM_PLATE, category = RecipeCategory.MISC)
			.rowB(MItemTags.CARBON_PLATES)
			.row(MItemTags.CARBON_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.CARBON_PLATES)
			.rowB(MItemTags.CARBON_PLATES)
			.unlockedBy(MItemTags.TRITANIUM_PLATES)
			.build(consumer)

	MatteryRecipe(MItems.CARBON_FIBRE_BLOCK, category = RecipeCategory.BUILDING_BLOCKS)
		.rowAB(MItemTags.CARBON_PLATES, MItemTags.CARBON_PLATES)
		.rowAB(MItemTags.CARBON_PLATES, MItemTags.CARBON_PLATES)
		.unlockedBy(MItemTags.CARBON_PLATES)
		.build(consumer)

	ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.CARBON_MESH, 4)
		.requires(Ingredient.of(MItems.CARBON_FIBRE_BLOCK))
		.unlockedBy(MItemTags.CARBON_PLATES)
		.unlockedBy(MItems.CARBON_FIBRE_BLOCK)
		.save(consumer, modLocation("carbon_mesh_from_block"))

	// броня
	MatteryRecipe(MItems.TRITANIUM_HELMET, category = RecipeCategory.COMBAT)
		.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_HELMET, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
		.build(consumer)

	MatteryRecipe(MItems.TRITANIUM_PANTS, category = RecipeCategory.COMBAT)
		.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_LEGGINGS, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.rowAC(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
		.build(consumer)

	MatteryRecipe(MItems.TRITANIUM_CHESTPLATE, category = RecipeCategory.COMBAT)
		.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_CHESTPLATE, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
		.build(consumer)

	MatteryRecipe(MItems.TRITANIUM_BOOTS, category = RecipeCategory.COMBAT)
		.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_BOOTS, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.rowAC(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
		.build(consumer)

	// простая броня
	MatteryRecipe(MItems.SIMPLE_TRITANIUM_HELMET, category = RecipeCategory.COMBAT)
		.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
		.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
		.unlockedBy(MItemTags.TRITANIUM_INGOTS)
		.build(consumer)

	MatteryRecipe(MItems.SIMPLE_TRITANIUM_PANTS, category = RecipeCategory.COMBAT)
		.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
		.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
		.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
		.unlockedBy(MItemTags.TRITANIUM_INGOTS)
		.build(consumer)

	MatteryRecipe(MItems.SIMPLE_TRITANIUM_CHESTPLATE, category = RecipeCategory.COMBAT)
		.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
		.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
		.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
		.unlockedBy(MItemTags.TRITANIUM_INGOTS)
		.build(consumer)

	MatteryRecipe(MItems.SIMPLE_TRITANIUM_BOOTS, category = RecipeCategory.COMBAT)
		.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
		.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
		.unlockedBy(MItemTags.TRITANIUM_INGOTS)
		.build(consumer)

	// простые батарейки
	MatteryRecipe(MItems.BATTERY_CRUDE, category = RecipeCategory.MISC)
		.rowB(Tags.Items.DUSTS_REDSTONE)
		.rowB(Tags.Items.CROPS_POTATO)
		.rowB(Tags.Items.INGOTS_IRON)
		.build(consumer)

	MatteryRecipe(MItems.BATTERY_BASIC, category = RecipeCategory.MISC)
		.rowAC(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
		.rowB(MItems.ELECTRIC_PARTS)
		.rowB(MItemTags.IRON_PLATES)
		.build(consumer)

	MatteryRecipe(MItems.BATTERY_NORMAL, category = RecipeCategory.MISC)
		.rowB(MItems.ELECTRIC_PARTS)
		.row(MItemTags.COPPER_WIRES, MItemTags.IRON_PLATES, MItemTags.COPPER_WIRES)
		.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
		.build(consumer)

	MatteryRecipe(MItems.BATTERY_DENSE, category = RecipeCategory.MISC)
		.row(Tags.Items.DUSTS_REDSTONE, MItems.ENERGY_BUS, Tags.Items.DUSTS_REDSTONE)
		.row(MItemTags.GOLD_WIRES, MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
		.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
		.build(consumer)

	MatteryRecipe(MItems.BATTERY_CAPACITOR, category = RecipeCategory.MISC)
		.row(Tags.Items.DUSTS_REDSTONE, MItems.ENERGY_BUS, Tags.Items.DUSTS_REDSTONE)
		.row(MItemTags.GOLD_WIRES, MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
		.row(MItemTags.GOLD_WIRES, Tags.Items.DUSTS_REDSTONE, MItemTags.GOLD_WIRES)
		.build(consumer)

	// накопители материи
	MatteryRecipe(MItems.MATTER_CAPACITOR_DENSE, category = RecipeCategory.MISC)
		.row(MItems.MATTER_CAPACITOR_PARTS, Tags.Items.GLASS, MItems.MATTER_CAPACITOR_PARTS)
		.row(MItemTags.TRITANIUM_PLATES, Tags.Items.ENDER_PEARLS, MItemTags.TRITANIUM_PLATES)
		.rowAC(Tags.Items.GEMS_DIAMOND, Tags.Items.GEMS_DIAMOND)
		.build(consumer)

	// станция андроида
	MatteryRecipe(MItems.ANDROID_STATION, category = machinesCategory)
		.row(MItems.ELECTRIC_PARTS, MItemTags.ADVANCED_CIRCUIT, MItems.ELECTRIC_PARTS)
		.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
		.row(MItemTags.TRITANIUM_PLATES, MItems.ELECTRIC_PARTS, MItemTags.TRITANIUM_PLATES)
		.build(consumer)

	// беспроводной зарядник андроидов
	MatteryRecipe(MItems.ANDROID_CHARGER, category = machinesCategory)
		.row(MItems.ELECTRIC_PARTS, MItems.QUANTUM_TRANSCEIVER, MItems.ELECTRIC_PARTS)
		.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
		.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
		.build(consumer)

	// Энерго меч
	MatteryRecipe(MItems.ENERGY_SWORD, category = RecipeCategory.COMBAT)
		.rowBC(MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
		.rowBC(MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
		.row(MItems.BATTERY_CAPACITOR, MItems.TRITANIUM_SWORD, MItemTags.ADVANCED_CIRCUIT)
		.unlockedBy(MItems.BATTERY_CAPACITOR)
		.buildEnergetic(consumer)

	// апгрейд на сетку крафта
	MatteryRecipe(MItems.ExopackUpgrades.CRAFTING_UPGRADE, category = RecipeCategory.TOOLS)
		.row(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
		.row(MItemTags.CRAFTING_TABLES, MItems.QUANTUM_TRANSCEIVER, MItemTags.CRAFTING_TABLES)
		.row(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
		.build(consumer)

	// апгрейд на переплавку
	MatteryRecipe(MItems.ExopackUpgrades.SMELTING_UPGRADE, category = RecipeCategory.TOOLS)
		.row(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
		.row(Items.FURNACE, MItems.QUANTUM_TRANSCEIVER, Items.FURNACE)
		.row(MItemTags.TRITANIUM_PLATES, Items.FURNACE, MItemTags.TRITANIUM_PLATES)
		.build(consumer)

	// генератор коблы
	MatteryRecipe(MItems.COBBLESTONE_GENERATOR, category = machinesCategory)
		.row(MItemTags.HARDENED_GLASS_COLORLESS, MItems.TRITANIUM_PICKAXE, MItemTags.HARDENED_GLASS_COLORLESS)
		.row(Items.LAVA_BUCKET, Items.HOPPER, Items.WATER_BUCKET)
		.rowB(Tags.Items.CHESTS)
		.build(consumer)

	MatteryRecipe(MItems.TRITANIUM_SHEARS, category = RecipeCategory.TOOLS)
		.rowB(MItemTags.TRITANIUM_INGOTS)
		.rowA(MItemTags.TRITANIUM_INGOTS)
		.build(consumer)

	MatteryRecipe(MItems.TRITANIUM_SHIELD, category = RecipeCategory.COMBAT)
		.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.SHIELD, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES)
		.rowB(MItemTags.REINFORCED_TRITANIUM_PLATES)
		.build(consumer)

	ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_NUGGET, 9)
		.requires(MItemTags.TRITANIUM_INGOTS)
		.unlockedBy(MItemTags.TRITANIUM_INGOTS)
		.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
		.save(consumer)

	ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1)
		.requires(Ingredient.of(MItemTags.TRITANIUM_NUGGETS), 9)
		.unlockedBy(MItemTags.TRITANIUM_INGOTS)
		.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
		.save(consumer, modLocation("ingot_from_nuggets"))

	MatteryRecipe(MItems.ESSENCE_STORAGE, category = machinesCategory)
		.row(MItems.MATTER_CAPACITOR_PARTS, Items.ENDER_EYE, MItemTags.ADVANCED_CIRCUIT)
		.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
		.row(MItemTags.GOLD_WIRES, MItemTags.HARDENED_GLASS, MItemTags.HARDENED_GLASS)
		.build(consumer)

	MatteryRecipe(MItems.ESSENCE_SERVO, category = RecipeCategory.TOOLS)
		.row(MItemTags.TRITANIUM_PLATES, MItems.QUANTUM_TRANSCEIVER, MItemTags.TRITANIUM_PLATES)
		.rowB(Tags.Items.RODS_WOODEN)
		.rowB(Tags.Items.RODS_WOODEN)
		.build(consumer)

	MatteryRecipe(MItems.MATTER_RECONSTRUCTOR, category = machinesCategory)
		.setUpgradeSource(MItems.MATTER_REPLICATOR)
		.addUpgradeOps(
			UpgradeRecipe.Indirect("BlockEntityTag.${MatteryBlockEntity.ENERGY_KEY}", "BlockEntityTag.energy"),
			UpgradeRecipe.Indirect("BlockEntityTag.${MatteryBlockEntity.MATTER_STORAGE_KEY}", "BlockEntityTag.matter"),
		)
		.row(MItemTags.ADVANCED_CIRCUIT, Tags.Items.GEMS_EMERALD, MItemTags.ADVANCED_CIRCUIT)
		.row(MItems.ELECTRIC_PARTS, MItems.MATTER_REPLICATOR, MItems.ELECTRIC_PARTS)
		.row(MItems.ELECTROMAGNET, MItems.ELECTROMAGNET, MItems.ELECTROMAGNET)
		.build(consumer)

	MatteryRecipe(MItems.FLUID_CAPSULE, category = RecipeCategory.TOOLS, count = 8)
		.row(MItemTags.TRITANIUM_NUGGETS, MItemTags.TRITANIUM_NUGGETS, MItemTags.TRITANIUM_NUGGETS)
		.rowB(MItemTags.HARDENED_GLASS_PANES)
		.row(MItemTags.TRITANIUM_NUGGETS, MItemTags.TRITANIUM_NUGGETS, MItemTags.TRITANIUM_NUGGETS)
		.unlockedBy(MItemTags.HARDENED_GLASS_PANES)
		.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
		.build(consumer)

	MatteryRecipe(MItems.FLUID_TANK, category = RecipeCategory.DECORATIONS)
		.row(MItemTags.TRITANIUM_INGOTS, MItemTags.HARDENED_GLASS_PANES, MItemTags.TRITANIUM_INGOTS)
		.rowAC(MItemTags.HARDENED_GLASS_PANES, MItemTags.HARDENED_GLASS_PANES)
		.row(MItemTags.TRITANIUM_INGOTS, MItemTags.HARDENED_GLASS_PANES, MItemTags.TRITANIUM_INGOTS)
		.unlockedBy(MItemTags.HARDENED_GLASS_PANES)
		.unlockedBy(MItemTags.TRITANIUM_INGOTS)
		.build(consumer)

	consumer.accept(ExplosiveHammerPrimingRecipe(modLocation("hammer_priming"), Ingredient.of(Tags.Items.NUGGETS_IRON)).finishedRecipe)

	MatteryRecipe(MItems.EXPLOSIVE_HAMMER, category = RecipeCategory.COMBAT)
		.rowB(Tags.Items.INGOTS_IRON)
		.rowAB(Tags.Items.INGOTS_IRON, Tags.Items.RODS_WOODEN)
		.rowB(Tags.Items.RODS_WOODEN)
		.unlockedBy(Items.FLINT_AND_STEEL)
		.build(consumer)

	MatteryRecipe(MItems.POWERED_FURNACE, category = machinesCategory)
		.row(Items.FURNACE, MItems.MACHINE_FRAME, Items.FURNACE)
		.unlockedBy(MItems.MACHINE_FRAME)
		.build(consumer)

	MatteryRecipe(MItems.POWERED_SMOKER, category = machinesCategory)
		.rowAC(Items.FURNACE, Items.FURNACE)
		.row(MItems.ELECTROMAGNET, MItems.MACHINE_FRAME, MItems.ELECTROMAGNET)
		.unlockedBy(MItems.MACHINE_FRAME)
		.build(consumer)

	MatteryRecipe(MItems.POWERED_BLAST_FURNACE, category = machinesCategory)
		.row(MItems.ELECTROMAGNET, Items.FURNACE, MItems.ELECTROMAGNET)
		.row(MItems.ELECTROMAGNET, MItems.MACHINE_FRAME, MItems.ELECTROMAGNET)
		.row(MItems.ELECTROMAGNET, Items.FURNACE, MItems.ELECTROMAGNET)
		.unlockedBy(MItems.MACHINE_FRAME)
		.build(consumer)
}
