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.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.ConventionalBlockTags;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.BlockTags;

import java.util.concurrent.CompletableFuture;

public class ModBlockTagProvider extends FabricTagProvider.BlockTagProvider {
    public ModBlockTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
        super(output, registriesFuture);
    }

    @Override
    protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) {
        valueLookupBuilder(BlockTags.PICKAXE_MINEABLE)
                .add(ModBlocks.RAW_ENTROPY_BLOCK)
                .add(ModBlocks.STABLE_ENTROPY_BLOCK)
                .add(ModBlocks.RAW_ENDTROPY_BLOCK)
                .add(ModBlocks.STABLE_ENDTROPY_BLOCK)
                .add(ModBlocks.PRISMA_STEEL_BLOCK)
                .add(ModBlocks.ASHEN_STEEL_BLOCK)
                .add(ModBlocks.FRACTAL_DIAMOND_BLOCK)
                .add(ModBlocks.HELLFIRE_DIAMOND_BLOCK)
                .add(ModBlocks.ENTROPY_ORE)
                .add(ModBlocks.DEEPSLATE_ENTROPY_ORE)
                .add(ModBlocks.INFERNAL_ASHES_ORE)
                .add(ModBlocks.ENDTROPY_ORE)
                .add(ModBlocks.ENTROPIC_STABILIZER)
                .add(ModBlocks.ENTROPIC_EVISCERATOR)
                .add(ModBlocks.ENTROPIC_ENTANGLER);

        valueLookupBuilder(BlockTags.NEEDS_IRON_TOOL)
                .add(ModBlocks.INFERNAL_ASHES_ORE)
                .add(ModBlocks.ENTROPIC_STABILIZER)
                .add(ModBlocks.ENTROPIC_EVISCERATOR)
                .add(ModBlocks.ENTROPIC_ENTANGLER);

        valueLookupBuilder(BlockTags.NEEDS_DIAMOND_TOOL)
                .add(ModBlocks.ENTROPY_ORE)
                .add(ModBlocks.DEEPSLATE_ENTROPY_ORE)
                .add(ModBlocks.ENDTROPY_ORE)
                .add(ModBlocks.RAW_ENTROPY_BLOCK)
                .add(ModBlocks.STABLE_ENTROPY_BLOCK)
                .add(ModBlocks.RAW_ENDTROPY_BLOCK)
                .add(ModBlocks.STABLE_ENDTROPY_BLOCK)
                .add(ModBlocks.PRISMA_STEEL_BLOCK)
                .add(ModBlocks.ASHEN_STEEL_BLOCK)
                .add(ModBlocks.FRACTAL_DIAMOND_BLOCK)
                .add(ModBlocks.HELLFIRE_DIAMOND_BLOCK);


        valueLookupBuilder(BlockTags.AXE_MINEABLE)
                .add(LemonWoodBlocks.LEMONWOOD_PLANKS)
                .add(LemonWoodBlocks.LEMONWOOD_WALL)
                .add(LemonWoodBlocks.LEMONWOOD_FENCE)
                .add(LemonWoodBlocks.LEMONWOOD_FENCE_GATE)
                .add(FireOakBlocks.FIRE_OAK_PLANKS)
                .add(FireOakBlocks.FIRE_OAK_WALL)
                .add(FireOakBlocks.FIRE_OAK_FENCE)
                .add(FireOakBlocks.FIRE_OAK_FENCE_GATE)
                .add(ModBlocks.LIZARD_PLANKS)
                .add(ModBlocks.LIZARD_BUTTON);

        valueLookupBuilder(BlockTags.SHOVEL_MINEABLE)
                .add(ModBlocks.INFERNAL_ASHES_BLOCK);

        valueLookupBuilder(BlockTags.WOODEN_FENCES)
                .add(LemonWoodBlocks.LEMONWOOD_FENCE)
                .add(FireOakBlocks.FIRE_OAK_FENCE);

        valueLookupBuilder(BlockTags.FENCE_GATES)
                .add(LemonWoodBlocks.LEMONWOOD_FENCE_GATE)
                .add(FireOakBlocks.FIRE_OAK_FENCE_GATE);

        valueLookupBuilder(BlockTags.WALLS)
                .add(LemonWoodBlocks.LEMONWOOD_WALL)
                .add(FireOakBlocks.FIRE_OAK_WALL);

        valueLookupBuilder(BlockTags.IMPERMEABLE)
                .add(ModBlocks.CRYSTAL_ENTROPY)
                .add(ModBlocks.CRYSTAL_ENTROPY_PANE);

        valueLookupBuilder(BlockTags.LEAVES)
                .add(LemonWoodBlocks.LEMONWOOD_LEAVES)
                .add(FireOakBlocks.FIRE_OAK_LEAVES);

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

        valueLookupBuilder(BlockTags.LOGS)
                .add(FireOakBlocks.FIRE_OAK_LOG)
                .add(FireOakBlocks.FIRE_OAK_WOOD)
                .add(FireOakBlocks.STRIPPED_FIRE_OAK_LOG)
                .add(FireOakBlocks.STRIPPED_FIRE_OAK_WOOD);

        // Common Block Tags
        valueLookupBuilder(ConventionalBlockTags.ORES)
                .add(ModBlocks.ENTROPY_ORE)
                .add(ModBlocks.DEEPSLATE_ENTROPY_ORE)
                .add(ModBlocks.INFERNAL_ASHES_ORE)
                .add(ModBlocks.ENDTROPY_ORE);
        valueLookupBuilder(ModTags.Blocks.MC_ORES)
                .add(ModBlocks.ENTROPY_ORE)
                .add(ModBlocks.DEEPSLATE_ENTROPY_ORE)
                .add(ModBlocks.INFERNAL_ASHES_ORE)
                .add(ModBlocks.ENDTROPY_ORE);
    }
}
