package net.Chipperfluff.chipi.item;

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;

import net.Chipperfluff.chipi.ChipiMod;
import net.Chipperfluff.chipi.block.ModBlocks;
import net.Chipperfluff.chipi.item.music.ModMusicDiscs;

public class ModItemGroups {

    public static final ItemGroup CHIPI_GROUP = Registry.register(
        Registries.ITEM_GROUP,
        new Identifier(ChipiMod.MOD_ID, "chipi"),
        FabricItemGroup.builder()
            .displayName(Text.translatable("itemGroup.chipi.chipi"))
            .icon(() -> new ItemStack(ModBlocks.VOID_BLOCK.asItem()))
            .entries((context, entries) -> {
                // Blocks
                entries.add(ModBlocks.VOID_BLOCK);
                entries.add(ModBlocks.CHIPPER_FRAME);
                entries.add(ModBlocks.CHIPPER_PORTAL);
                entries.add(ModBlocks.CHIPPER_ORE);
                entries.add(ModBlocks.CHIPPER_ALLOY_BLOCK);
                entries.add(ModBlocks.JINGLE_BLOCK);

                // Items
                entries.add(ModItems.RAW_CHIPPER_ORE);
                entries.add(ModItems.CHIPPER_INGOT);
                entries.add(ModItems.CHIPPER_ALLOY);
                entries.add(ModItems.MEP_SPAWN_EGG);

                // Food
                entries.add(ModItems.MEP_MILK);
                entries.add(ModItems.NUT);
                entries.add(ModItems.PLAYER_MILK);

                // Armor
                entries.add(ModItems.CHIPPER_HELMET);
                entries.add(ModItems.CHIPPER_CHESTPLATE);
                entries.add(ModItems.CHIPPER_LEGGINGS);
                entries.add(ModItems.CHIPPER_BOOTS);

                // Tools
                entries.add(ModItems.CHIPPER_SWORD);
                entries.add(ModItems.CHIPPER_PICKAXE);
                entries.add(ModItems.CHIPPER_AXE);
                entries.add(ModItems.CHIPPER_SHOVEL);
                entries.add(ModItems.CHIPPER_HOE);

                // Music discs
                for (var disc : ModMusicDiscs.getAll().values()) {
                    entries.add(disc);
                }
            })
            .build()
    );

    public static void register() {}
}
