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

import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.tags.ItemTags
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems

fun addComponentRecipes(consumer: RecipeOutput) {
	// Обычный рецепт
	MatteryRecipe(MItems.BASIC_CONTROL_CIRCUIT, count = 3, category = RecipeCategory.MISC)
		.row(MItemTags.COPPER_WIRES, Tags.Items.DUSTS_REDSTONE, MItemTags.COPPER_WIRES)
		.row(MItems.CIRCUIT_PLATING, MItems.CIRCUIT_PLATING, MItems.CIRCUIT_PLATING)
		.unlockedBy(MItemTags.COPPER_WIRES)
		.build(consumer)

	// ручной рецепт
	MatteryRecipe(MItems.BASIC_CONTROL_CIRCUIT, category = RecipeCategory.MISC)
		.rowB(Tags.Items.DUSTS_REDSTONE)
		.rowB(MItemTags.COPPER_WIRES)
		.rowB(ItemTags.WOODEN_SLABS)
		.unlockedBy(MItemTags.COPPER_WIRES)
		.unlockedBy(Tags.Items.DUSTS_REDSTONE)
		.build(consumer, "alt")

	MatteryRecipe(MItems.ADVANCED_CONTROL_CIRCUIT, count = 3, category = RecipeCategory.MISC)
		.row(MItemTags.COPPER_WIRES, Tags.Items.GEMS_QUARTZ, MItemTags.COPPER_WIRES)
		.row(MItemTags.GOLD_WIRES, Tags.Items.DUSTS_REDSTONE, MItemTags.GOLD_WIRES)
		.row(MItems.CIRCUIT_PLATING, MItems.CIRCUIT_PLATING, MItems.CIRCUIT_PLATING)
		.unlockedBy(MItemTags.GOLD_WIRES)
		.build(consumer)

	MatteryRecipe(MItems.MACHINE_FRAME, category = RecipeCategory.MISC)
		.row(MItemTags.HARDENED_GLASS, MItemTags.BASIC_CIRCUIT, MItemTags.HARDENED_GLASS)
		.row(MItems.ELECTRIC_PARTS, MItemTags.TRITANIUM_PLATES, MItems.ELECTRIC_PARTS)
		.rowAC(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
		.unlockedBy(MItemTags.BASIC_CIRCUIT)
		.unlockedBy(MItemTags.HARDENED_GLASS)
		.unlockedBy(MItems.ELECTRIC_PARTS)
		.build(consumer)

	MatteryRecipe(MItems.GOLD_WIRING, count = 8, category = RecipeCategory.MISC)
		.rowB(Tags.Items.INGOTS_GOLD)
		.row(Tags.Items.INGOTS_GOLD, Tags.Items.RODS_WOODEN, Tags.Items.INGOTS_GOLD)
		.rowB(Tags.Items.INGOTS_GOLD)
		.unlockedBy(Tags.Items.INGOTS_GOLD)
		.build(consumer)

	MatteryRecipe(MItems.COPPER_WIRING, count = 8, category = RecipeCategory.MISC)
		.rowB(Tags.Items.INGOTS_COPPER)
		.row(Tags.Items.INGOTS_COPPER, Tags.Items.RODS_WOODEN, Tags.Items.INGOTS_COPPER)
		.rowB(Tags.Items.INGOTS_COPPER)
		.unlockedBy(Tags.Items.INGOTS_COPPER)
		.build(consumer)

	MatteryRecipe(MItems.ENERGY_BUS, count = 2, category = RecipeCategory.MISC)
		.rowAB(Tags.Items.DUSTS_REDSTONE, MItems.ELECTRIC_PARTS)
		.row(MItemTags.COPPER_WIRES, MItemTags.COPPER_WIRES, MItemTags.COPPER_WIRES)
		.rowBC(MItems.ELECTRIC_PARTS, Tags.Items.DUSTS_REDSTONE)
		.unlockedBy(MItems.ELECTRIC_PARTS)
		.unlockedBy(MItemTags.COPPER_WIRES)
		.unlockedBy(Tags.Items.DUSTS_REDSTONE)
		.build(consumer)

	MatteryRecipe(MItems.MATTER_IO_PORT, category = RecipeCategory.MISC)
		.rowB(MItems.MATTER_CABLE)
		.row(MItemTags.TRITANIUM_PLATES, MItemTags.BASIC_CIRCUIT, MItemTags.TRITANIUM_PLATES)
		.rowB(MItems.MATTER_CABLE)
		.unlockedBy(MItems.MATTER_CABLE)
		.build(consumer)

	MatteryRecipe(MItems.MATTER_TRANSFORM_MATRIX, category = RecipeCategory.MISC)
		.row(MItemTags.DILITHIUM_GEMS, MItems.MATTER_CABLE, MItemTags.DILITHIUM_GEMS)
		.row(MItemTags.TRITANIUM_PLATES, MItemTags.ADVANCED_CIRCUIT, MItemTags.TRITANIUM_PLATES)
		.rowB(MItems.MATTER_CABLE)
		.unlockedBy(MItems.MATTER_CABLE)
		.build(consumer)

	MatteryRecipe(MItems.MATTER_CAPACITOR_PARTS, count = 3, category = RecipeCategory.MISC)
		.row(MItemTags.IRON_PLATES, MItemTags.HARDENED_GLASS_PANES, MItemTags.IRON_PLATES)
		.row(MItemTags.TRITANIUM_PLATES, MItemTags.HARDENED_GLASS_PANES, MItemTags.TRITANIUM_PLATES)
		.rowB(MItemTags.HARDENED_GLASS_PANES)
		.unlockedBy(MItems.MATTER_CABLE)
		.build(consumer)

	MatteryRecipe(MItems.ELECTRIC_PARTS, count = 4, category = RecipeCategory.MISC)
		.row(Tags.Items.DUSTS_REDSTONE, MItemTags.COPPER_WIRES, Tags.Items.DUSTS_REDSTONE)
		.row(Tags.Items.NUGGETS_GOLD, Tags.Items.NUGGETS_IRON, Tags.Items.NUGGETS_GOLD)
		.row(Tags.Items.DUSTS_REDSTONE, MItemTags.COPPER_WIRES, Tags.Items.DUSTS_REDSTONE)
		.build(consumer)

	MatteryRecipe(MItems.MECHANICAL_PARTS, count = 4, category = RecipeCategory.MISC)
		.row(MItemTags.TRITANIUM_INGOTS, Tags.Items.INGOTS_IRON, MItemTags.TRITANIUM_INGOTS)
		.build(consumer)

	MatteryRecipe(MItems.ELECTROMOTOR, category = RecipeCategory.MISC)
		.rowB(MItems.ELECTRIC_PARTS)
		.row(MItems.ELECTROMAGNET, MItems.MECHANICAL_PARTS, MItems.ELECTROMAGNET)
		.row(MItemTags.COPPER_WIRES, MItems.MECHANICAL_PARTS, MItemTags.COPPER_WIRES)
		.unlockedBy(MItems.ELECTROMAGNET)
		.build(consumer)

	MatteryRecipe(MItems.DISPLAY_SCREEN, 3)
		.row(MItemTags.IRON_PLATES, Tags.Items.DUSTS_GLOWSTONE, Tags.Items.GLASS_PANES_COLORLESS)
		.row(MItemTags.IRON_PLATES, Tags.Items.DUSTS_REDSTONE, Tags.Items.GLASS_PANES_COLORLESS)
		.row(MItemTags.IRON_PLATES, Tags.Items.DUSTS_GLOWSTONE, Tags.Items.GLASS_PANES_COLORLESS)
		.build(consumer)
}
