package com.acethewildfire.acesbs.datagen;

import com.acethewildfire.acesbs.block.FireOakBlocks;
import com.acethewildfire.acesbs.block.LemonWoodBlocks;
import com.acethewildfire.acesbs.block.ModBlocks;
import com.acethewildfire.acesbs.item.*;
import com.acethewildfire.acesbs.util.ModTags;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags;
import net.minecraft.item.Items;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.ItemTags;

import java.util.concurrent.CompletableFuture;

public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {

    public ModItemTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> completableFuture) {
        super(output, completableFuture);
    }

    @Override
    protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) {
        valueLookupBuilder(ModTags.Items.ENTROPY_CONVERTABLE)
                .add(Items.APPLE);

        valueLookupBuilder(ModTags.Items.PRISMA_REPAIR)
                .add(PrismaSteelItems.PRISMA_STEEL);

        valueLookupBuilder(ModTags.Items.ASHEN_REPAIR)
                .add(AshenSteelItems.ASHEN_STEEL);

        valueLookupBuilder(ModTags.Items.FRACTAL_REPAIR)
                .add(FractalDiamondItems.FRACTAL_DIAMOND);

        valueLookupBuilder(ModTags.Items.HELLFIRE_REPAIR)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND);

        valueLookupBuilder(ModTags.Items.WILDFIRE_REPAIR)
                .add(ModItems.INFERNAL_ASHES);

        valueLookupBuilder(ModTags.Items.PLATES_REPAIR)
                .add(AshenSteelItems.ASHEN_STEEL);

        valueLookupBuilder(ModTags.Items.BERSERKERS_REPAIR)
                .add(Items.LEATHER);

        valueLookupBuilder(ModTags.Items.PRISMA_CONVERTABLE)
                .add(Items.COAL)
                .add(Items.RAW_COPPER)
                .add(Items.RAW_IRON)
                .add(Items.RAW_GOLD)
                .add(Items.REDSTONE)
                .add(Items.LAPIS_LAZULI)
                .add(Items.EMERALD)
                .add(Items.DIAMOND);

        valueLookupBuilder(ItemTags.BOW_ENCHANTABLE)
                .add(ModItems.KAUPEN_BOW);

        valueLookupBuilder(ItemTags.SWORDS)
                .add(PrismaSteelItems.PRISMA_STEEL_SWORD)
                .add(AshenSteelItems.ASHEN_STEEL_SWORD)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_SWORD)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_SWORD)
                .add(ModItems.THOT_BEGONE);

        valueLookupBuilder(ItemTags.AXES)
                .add(PrismaSteelItems.PRISMA_STEEL_AXE)
                .add(AshenSteelItems.ASHEN_STEEL_AXE)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_AXE)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_AXE);

        valueLookupBuilder(ItemTags.PICKAXES)
                .add(PrismaSteelItems.PRISMA_STEEL_PICKAXE)
                .add(AshenSteelItems.ASHEN_STEEL_PICKAXE)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_PICKAXE)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_PICKAXE)
                .add(PrismaSteelItems.PRISMA_STEEL_HAMMER)
                .add(AshenSteelItems.ASHEN_STEEL_HAMMER)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_HAMMER)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_HAMMER);

        valueLookupBuilder(ItemTags.SHOVELS)
                .add(PrismaSteelItems.PRISMA_STEEL_SHOVEL)
                .add(AshenSteelItems.ASHEN_STEEL_PICKAXE)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_SHOVEL)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_SHOVEL);

        valueLookupBuilder(ItemTags.HOES)
                .add(PrismaSteelItems.PRISMA_STEEL_HOE)
                .add(AshenSteelItems.ASHEN_STEEL_HOE)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_HOE)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_HOE);

        valueLookupBuilder(ItemTags.TRIMMABLE_ARMOR)
                .add(PrismaSteelItems.PRISMA_STEEL_HELMET)
                .add(PrismaSteelItems.PRISMA_STEEL_CHESTPLATE)
                .add(PrismaSteelItems.PRISMA_STEEL_LEGGINGS)
                .add(PrismaSteelItems.PRISMA_STEEL_BOOTS)
                .add(AshenSteelItems.ASHEN_STEEL_HELMET)
                .add(AshenSteelItems.ASHEN_STEEL_CHESTPLATE)
                .add(AshenSteelItems.ASHEN_STEEL_LEGGINGS)
                .add(AshenSteelItems.ASHEN_STEEL_BOOTS)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_HELMET)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_CHESTPLATE)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_LEGGINGS)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_BOOTS)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_HELMET)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_CHESTPLATE)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_LEGGINGS)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_BOOTS)
                .add(ModItems.BERSERKERS_PAULDRON)
                .add(ModItems.WILDFIRE_BOOTS)
                .add(ModItems.SOVS_PLATE_CARRIER);

        valueLookupBuilder(ItemTags.ARMOR_ENCHANTABLE)
                .add(PrismaSteelItems.PRISMA_STEEL_HELMET)
                .add(PrismaSteelItems.PRISMA_STEEL_CHESTPLATE)
                .add(PrismaSteelItems.PRISMA_STEEL_LEGGINGS)
                .add(PrismaSteelItems.PRISMA_STEEL_BOOTS)
                .add(AshenSteelItems.ASHEN_STEEL_HELMET)
                .add(AshenSteelItems.ASHEN_STEEL_CHESTPLATE)
                .add(AshenSteelItems.ASHEN_STEEL_LEGGINGS)
                .add(AshenSteelItems.ASHEN_STEEL_BOOTS)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_HELMET)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_CHESTPLATE)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_LEGGINGS)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_BOOTS)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_HELMET)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_CHESTPLATE)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_LEGGINGS)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_BOOTS)
                .add(ModItems.BERSERKERS_PAULDRON)
                .add(ModItems.WILDFIRE_BOOTS);

        valueLookupBuilder(ItemTags.HEAD_ARMOR_ENCHANTABLE)
                .add(PrismaSteelItems.PRISMA_STEEL_HELMET)
                .add(AshenSteelItems.ASHEN_STEEL_HELMET)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_HELMET)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_HELMET);

        valueLookupBuilder(ItemTags.CHEST_ARMOR_ENCHANTABLE)
                .add(PrismaSteelItems.PRISMA_STEEL_CHESTPLATE)
                .add(AshenSteelItems.ASHEN_STEEL_CHESTPLATE)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_CHESTPLATE)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_CHESTPLATE)
                .add(ModItems.BERSERKERS_PAULDRON);

        valueLookupBuilder(ItemTags.LEG_ARMOR_ENCHANTABLE)
                .add(PrismaSteelItems.PRISMA_STEEL_LEGGINGS)
                .add(AshenSteelItems.ASHEN_STEEL_LEGGINGS)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_LEGGINGS)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_LEGGINGS);

        valueLookupBuilder(ItemTags.FOOT_ARMOR_ENCHANTABLE)
                .add(PrismaSteelItems.PRISMA_STEEL_BOOTS)
                .add(AshenSteelItems.ASHEN_STEEL_BOOTS)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_BOOTS)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_BOOTS)
                .add(ModItems.WILDFIRE_BOOTS);


        valueLookupBuilder(ItemTags.TRIM_MATERIALS)
                .add(PrismaSteelItems.PRISMA_STEEL)
                .add(AshenSteelItems.ASHEN_STEEL)
                .add(FractalDiamondItems.FRACTAL_DIAMOND)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND);

        valueLookupBuilder(ItemTags.CREEPER_DROP_MUSIC_DISCS)
                .add(ModItems.CRAB_RAVE_MUSIC_DISC);

        valueLookupBuilder(ItemTags.LOGS_THAT_BURN)
                .add(LemonWoodBlocks.LEMONWOOD_LOG.asItem())
                .add(LemonWoodBlocks.LEMONWOOD_WOOD.asItem())
                .add(LemonWoodBlocks.STRIPPED_LEMONWOOD_LOG.asItem())
                .add(LemonWoodBlocks.STRIPPED_LEMONWOOD_WOOD.asItem());

        valueLookupBuilder(ItemTags.PLANKS)
                .add(LemonWoodBlocks.LEMONWOOD_PLANKS.asItem())
                .add(FireOakBlocks.FIRE_OAK_PLANKS.asItem())
                .add(ModBlocks.LIZARD_PLANKS.asItem());

        valueLookupBuilder(ItemTags.MEAT)
                .add(ModItems.INFERNAL_BEEF);

        // Common Item Tags

        valueLookupBuilder(ConventionalItemTags.FOODS)
                .add(ModItems.INFERNAL_BEEF);

        valueLookupBuilder(ConventionalItemTags.COOKED_MEAT_FOODS)
                .add(ModItems.INFERNAL_BEEF);

        valueLookupBuilder(ConventionalItemTags.ORES)
                .add(ModBlocks.ENTROPY_ORE.asItem())
                .add(ModBlocks.DEEPSLATE_ENTROPY_ORE.asItem())
                .add(ModBlocks.INFERNAL_ASHES_ORE.asItem())
                .add(ModBlocks.ENDTROPY_ORE.asItem());

        valueLookupBuilder(ConventionalItemTags.INGOTS)
                .add(PrismaSteelItems.PRISMA_STEEL)
                .add(AshenSteelItems.ASHEN_STEEL);

        valueLookupBuilder(ConventionalItemTags.GEMS)
                .add(FractalDiamondItems.FRACTAL_DIAMOND)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND);

        valueLookupBuilder(ConventionalItemTags.DIAMOND_GEMS)
                .add(FractalDiamondItems.FRACTAL_DIAMOND)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND);

        valueLookupBuilder(ConventionalItemTags.IRON_INGOTS)
                .add(PrismaSteelItems.PRISMA_STEEL)
                .add(AshenSteelItems.ASHEN_STEEL);

        valueLookupBuilder(ModTags.Items.C_INGOTS_STEEL)
                .add(PrismaSteelItems.PRISMA_STEEL)
                .add(AshenSteelItems.ASHEN_STEEL);

        valueLookupBuilder(ConventionalItemTags.STORAGE_BLOCKS)
                .add(ModBlocks.PRISMA_STEEL_BLOCK.asItem())
                .add(ModBlocks.ASHEN_STEEL_BLOCK.asItem())
                .add(ModBlocks.FRACTAL_DIAMOND_BLOCK.asItem())
                .add(ModBlocks.HELLFIRE_DIAMOND_BLOCK.asItem())
                .add(ModBlocks.RAW_ENTROPY_BLOCK.asItem())
                .add(ModBlocks.INFERNAL_ASHES_BLOCK.asItem())
                .add(ModBlocks.RAW_ENDTROPY_BLOCK.asItem());

        valueLookupBuilder(ConventionalItemTags.CROPS)
                .add(ModBlocks.TOBACCO_CROP.asItem());

        valueLookupBuilder(ConventionalItemTags.SEEDS)
                .add(ModItems.TOBACCO_SEEDS);

        valueLookupBuilder(ConventionalItemTags.MUSIC_DISCS)
                .add(ModItems.CRAB_RAVE_MUSIC_DISC);

        valueLookupBuilder(ConventionalItemTags.ENCHANTABLES)
                .add(PrismaSteelItems.PRISMA_STEEL_HELMET)
                .add(PrismaSteelItems.PRISMA_STEEL_CHESTPLATE)
                .add(PrismaSteelItems.PRISMA_STEEL_LEGGINGS)
                .add(PrismaSteelItems.PRISMA_STEEL_BOOTS)
                .add(AshenSteelItems.ASHEN_STEEL_HELMET)
                .add(AshenSteelItems.ASHEN_STEEL_CHESTPLATE)
                .add(AshenSteelItems.ASHEN_STEEL_LEGGINGS)
                .add(AshenSteelItems.ASHEN_STEEL_BOOTS)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_HELMET)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_CHESTPLATE)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_LEGGINGS)
                .add(FractalDiamondItems.FRACTAL_DIAMOND_BOOTS)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_HELMET)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_CHESTPLATE)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_LEGGINGS)
                .add(HellfireDiamondItems.HELLFIRE_DIAMOND_BOOTS)
                .add(ModItems.BERSERKERS_PAULDRON)
                .add(ModItems.WILDFIRE_BOOTS);
    }
}
