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

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

fun addStorageItemRecipes(consumer: RecipeOutput) {
	// простые батарейки
	MatteryRecipe(MItems.BATTERY_CRUDE, category = RecipeCategory.MISC)
		.rowB(Tags.Items.DUSTS_REDSTONE)
		.rowB(Tags.Items.CROPS_POTATO)
		.rowB(Tags.Items.INGOTS_IRON)
		.unlockedBy(Tags.Items.CROPS_POTATO)
		.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)
		.unlockedBy(Tags.Items.DUSTS_REDSTONE)
		.unlockedBy(MItems.ELECTRIC_PARTS)
		.build(consumer)

	MatteryRecipe(MItems.BATTERY_NORMAL, category = RecipeCategory.MISC)
		.setUpgradeSource(MItems.BATTERY_BASIC)
		.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
		.rowB(MItems.ELECTRIC_PARTS)
		.row(MItemTags.COPPER_WIRES, MItems.BATTERY_BASIC, 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)
		.setUpgradeSource(MItems.BATTERY_NORMAL)
		.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
		.row(Tags.Items.DUSTS_REDSTONE, MItems.ENERGY_BUS, Tags.Items.DUSTS_REDSTONE)
		.row(MItemTags.GOLD_WIRES, MItems.BATTERY_NORMAL, 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)
		.setUpgradeSource(MItems.BATTERY_NORMAL)
		.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
		.row(Tags.Items.DUSTS_REDSTONE, MItems.ENERGY_BUS, Tags.Items.DUSTS_REDSTONE)
		.row(MItemTags.GOLD_WIRES, MItems.BATTERY_NORMAL, MItemTags.GOLD_WIRES)
		.row(MItemTags.GOLD_WIRES, Tags.Items.DUSTS_REDSTONE, MItemTags.GOLD_WIRES)
		.build(consumer)

	// накопители материи
	MatteryRecipe(MItems.MATTER_CAPACITOR_BASIC, category = RecipeCategory.MISC)
		.row(MItemTags.IRON_PLATES, MItems.MATTER_CAPACITOR_PARTS, MItemTags.HARDENED_GLASS)
		.unlockedBy(MItems.MATTER_CAPACITOR_PARTS)
		.build(consumer)

	MatteryRecipe(MItems.MATTER_CAPACITOR_NORMAL, category = RecipeCategory.MISC)
		.setUpgradeSource(MItems.MATTER_CAPACITOR_BASIC)
		.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
		.rowB(MItems.MATTER_CAPACITOR_PARTS)
		.row(MItemTags.TRITANIUM_PLATES, MItems.MATTER_CAPACITOR_BASIC, MItemTags.TRITANIUM_PLATES)
		.rowB(Tags.Items.GEMS_DIAMOND)
		.unlockedBy(MItems.MATTER_CAPACITOR_BASIC)
		.build(consumer)

	MatteryRecipe(MItems.MATTER_CAPACITOR_DENSE, category = RecipeCategory.MISC)
		.setUpgradeSource(MItems.MATTER_CAPACITOR_NORMAL)
		.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
		.row(MItems.MATTER_CAPACITOR_PARTS, MItemTags.HARDENED_GLASS, MItems.MATTER_CAPACITOR_PARTS)
		.row(MItemTags.TRITANIUM_PLATES, MItems.MATTER_CAPACITOR_NORMAL, MItemTags.TRITANIUM_PLATES)
		.rowAC(Tags.Items.ENDER_PEARLS, Tags.Items.ENDER_PEARLS)
		.unlockedBy(MItems.MATTER_CAPACITOR_NORMAL)
		.build(consumer)
}
