package com.acethewildfire.acesbs.item;

import com.acethewildfire.acesbs.AcesBS;
import com.acethewildfire.acesbs.block.ModBlocks;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

public class ModItemGroups {
    public static final ItemGroup ACES_BS_ITEMS =
            FabricItemGroup.builder()
                    .icon(() -> new ItemStack(ModItems.RAW_ENTROPY))
                    .displayName(Text.translatable("itemgroup.acesbs.2_items"))
                    .entries((displayContext, entries) -> {
                        entries.add(ModItems.RAW_ENTROPY);
                        entries.add(ModItems.STABLE_ENTROPY);
                        entries.add(ModItems.INFERNAL_ASHES);
                        entries.add(ModItems.RAW_ENDTROPY);
                        entries.add(ModItems.STABLE_ENDTROPY);
                        entries.add(PrismaSteelItems.PRISMA_STEEL);
                        entries.add(ModItems.MOTE_OF_ORDER);
                        entries.add(ModItems.LEMON);
                        entries.add(ModItems.COOKED_LEMON);
                        entries.add(ModItems.INFERNAL_BEEF);
                        entries.add(ModItems.BRICKED_UP);
                        entries.add(ModItems.ORACLE_LEMON);
                        entries.add(ModItems.GREEN_BRICKS);
                        entries.add(ModItems.CRAB_RAVE_MUSIC_DISC);
                        entries.add(ModItems.TOBACCO_SEEDS);
                        entries.add(ModItems.TOBACCO);
                        entries.add(ModItems.CIGARETTE);
                        entries.add(ModItems.CIGARETTE_LEMON);
                        entries.add(ModItems.CIGARETTE_FUNNY);
                        entries.add(ModItems.FREN_SPAWN_EGG);
                    })
                    .build();

    public static final ItemGroup ACES_BS_BLOCKS =
            FabricItemGroup.builder()
                    .icon(() -> new ItemStack(ModBlocks.ENTROPY_BLOCK))
                    .displayName(Text.translatable("itemgroup.acesbs.1_blocks"))
                    .entries((displayContext, entries) -> {
                        entries.add(ModBlocks.ENTROPY_ORE);
                        entries.add(ModBlocks.DEEPSLATE_ENTROPY_ORE);
                        entries.add(ModBlocks.ENTROPY_BLOCK);
                        entries.add(ModBlocks.STABLE_ENTROPY_BLOCK);
                        entries.add(ModBlocks.INFERNAL_ASHES_ORE);
                        entries.add(ModBlocks.INFERNAL_ASHES_BLOCK);
                        entries.add(ModBlocks.ENDTROPY_ORE);

                        entries.add(ModBlocks.PRISMA_STEEL_BLOCK);

                        entries.add(ModBlocks.ENTROPIC_STABILIZER);
                        entries.add(ModBlocks.ENTROPIC_EVISCERATOR);
                        entries.add(ModBlocks.ENTROPIC_ENTANGLER);

                        entries.add(ModBlocks.LIZARD_PLANKS);
                        entries.add(ModBlocks.LIZARD_BUTTON);

                        entries.add(ModBlocks.LEMONWOOD_LOG);
                        entries.add(ModBlocks.LEMONWOOD_WOOD);
                        entries.add(ModBlocks.STRIPPED_LEMONWOOD_LOG);
                        entries.add(ModBlocks.STRIPPED_LEMONWOOD_WOOD);
                        entries.add(ModBlocks.LEMONWOOD_SAPLING);
                        entries.add(ModBlocks.LEMONWOOD_LEAVES);
                        entries.add(ModBlocks.LEMONWOOD_PLANKS);
                        entries.add(ModBlocks.LEMONWOOD_STAIRS);
                        entries.add(ModBlocks.LEMONWOOD_SLAB);
                        entries.add(ModBlocks.LEMONWOOD_BUTTON);
                        entries.add(ModBlocks.LEMONWOOD_PRESSURE_PLATE);
                        entries.add(ModBlocks.LEMONWOOD_FENCE);
                        entries.add(ModBlocks.LEMONWOOD_FENCE_GATE);
                        entries.add(ModBlocks.LEMONWOOD_WALL);
                        entries.add(ModBlocks.LEMONWOOD_DOOR);
                        entries.add(ModBlocks.LEMONWOOD_TRAPDOOR);

                        entries.add(ModBlocks.EVIL_BLOCK);
                        entries.add(ModBlocks.CRYSTAL_ENTROPY);
                        entries.add(ModBlocks.CRYSTAL_ENTROPY_PANE);

                    })
                    .build();

    public static final ItemGroup ACES_BS_COMBAT =
            FabricItemGroup.builder()
                    .icon(() -> new ItemStack(PrismaSteelItems.PRISMA_STEEL_SWORD))
                    .displayName(Text.translatable("itemgroup.acesbs.4_combat"))
                    .entries((displayContext, entries) -> {
                        entries.add(PrismaSteelItems.PRISMA_STEEL_SWORD);
                        entries.add(PrismaSteelItems.PRISMA_STEEL_AXE);
                        entries.add(PrismaSteelItems.PRISMA_STEEL_HELMET);
                        entries.add(PrismaSteelItems.PRISMA_STEEL_CHESTPLATE);
                        entries.add(PrismaSteelItems.PRISMA_STEEL_LEGGINGS);
                        entries.add(PrismaSteelItems.PRISMA_STEEL_BOOTS);
                        entries.add(PrismaSteelItems.PRISMA_SMITHING_TEMPLATE);
                        entries.add(ModItems.KAUPEN_BOW);
                        entries.add(ModItems.COMBUSTIBLE_LEMON);
                        entries.add(ModItems.BERSERKERS_PAULDRON);


                    })
                    .build();

    public static final ItemGroup ACES_BS_TOOLS =
            FabricItemGroup.builder()
                    .icon(() -> new ItemStack(PrismaSteelItems.PRISMA_STEEL_PICKAXE))
                    .displayName(Text.translatable("itemgroup.acesbs.3_tools"))
                    .entries((displayContext, entries) -> {
                        entries.add(ModItems.WAND);
                        entries.add(PrismaSteelItems.PRISMA_STEEL_SHOVEL);
                        entries.add(PrismaSteelItems.PRISMA_STEEL_PICKAXE);
                        entries.add(PrismaSteelItems.PRISMA_STEEL_HAMMER);
                        entries.add(PrismaSteelItems.PRISMA_STEEL_AXE);
                        entries.add(PrismaSteelItems.PRISMA_STEEL_HOE);



                    })
                    .build();


    public static void registerItemGroups() {
        AcesBS.LOGGER.info("Registering Item Groups for " + AcesBS.MOD_ID);
        Registry.register(Registries.ITEM_GROUP,
                Identifier.of(AcesBS.MOD_ID, "1_blocks"),ACES_BS_BLOCKS);
        Registry.register(Registries.ITEM_GROUP,
                Identifier.of(AcesBS.MOD_ID, "2_items"),ACES_BS_ITEMS);
        Registry.register(Registries.ITEM_GROUP,
                Identifier.of(AcesBS.MOD_ID, "3_tools"), ACES_BS_TOOLS);
        Registry.register(Registries.ITEM_GROUP,
                Identifier.of(AcesBS.MOD_ID, "4_combat"),ACES_BS_COMBAT);
    }
}
