package dev.micle.firefly_bush_backport.creative_mode_tab;

import dev.micle.firefly_bush_backport.FireflyBushBackport;
import dev.micle.firefly_bush_backport.block.ModBlocks;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;

public class ModCreativeModeTabs {
    public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, FireflyBushBackport.MOD_ID);

    public static final RegistryObject<CreativeModeTab> MAIN_TAB = CREATIVE_MODE_TABS.register( "main",
            () -> CreativeModeTab.builder()
                    .title(Component.translatable(String.format("itemGroup.%s.main", FireflyBushBackport.MOD_ID)))
                    .icon(ModBlocks.FIREFLY_BUSH.get().asItem()::getDefaultInstance)
                    .displayItems((itemDisplayParams, output) -> {
                        output.accept(ModBlocks.FIREFLY_BUSH.get());
                    })
                    .build()
    );

    public static void register(IEventBus modEventBus) {
        CREATIVE_MODE_TABS.register(modEventBus);
    }
}
