/*
 * Copyright (c) 2026 盐灯水母
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

package com.remains_cave;

import com.remains_cave.item.ModItems;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.damagesource.DamageType;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;

public class ModCreativeTabs {
    // 1. 创造模式标签注册表
    public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS =
            DeferredRegister.create(Registries.CREATIVE_MODE_TAB, RemainsCaveMod.MODID);
    public static final DeferredHolder<CreativeModeTab, CreativeModeTab> REMAINS_CAVE_TAB =
            CREATIVE_MODE_TABS.register("remains_cave_tab", () -> CreativeModeTab.builder()
                    .title(Component.translatable("itemGroup.remains_cave"))
                    .icon(() -> new ItemStack(ModItems.SKELETON_KING_TROPHY_ITEM.get()))
                    .displayItems((parameters, output) -> {
                        output.accept(ModItems.SKELETON_KING_SPAWN_EGG.get());
                        output.accept(ModItems.SKELETON_WARLOCK_SPAWN_EGG.get());
                        output.accept(ModItems.SKELETON_ARCHER_SPAWN_EGG.get());
                        output.accept(ModItems.SKELETON_WARRIOR_SPAWN_EGG.get());
                        output.accept(ModItems.STATELY_KEY.get());
                        output.accept(ModItems.SKELETON_KING_TROPHY_ITEM.get());
                        output.accept(ModItems.SKELETON_ARCHER_TROPHY_ITEM.get());
                        output.accept(ModItems.SKELETON_WARLOCK_TROPHY_ITEM.get());
                        output.accept(ModItems.SKELETON_WARRIOR_TROPHY_ITEM.get());
                        output.accept(ModItems.CRIMSON_CRYSTAL.get());
                        output.accept(ModItems.CRIMSON_BOND.get());
                        output.accept(ModItems.BONE_HATCHET.get());
                        output.accept(ModItems.DOOM_STAFF.get());
                        output.accept(ModItems.TOMB_BOW.get());
                        output.accept(ModItems.TOMB_QUIVER.get());
                        output.accept(ModItems.BONE_PAULDRON.get());
                        output.accept(ModItems.TOMB_ARROW.get());
                        output.accept(ModItems.BONE_STATELY.get());
                        output.accept(ModItems.TOMB_HAT.get());
                        output.accept(ModItems.BONE_HELMET.get());
                        output.accept(ModItems.DOOM_HOOD.get());
                        output.accept(ModItems.ROOM_VAULT_ITEM.get());
                        output.accept(ModItems.BOSS_VAULT_ITEM.get());
                        output.accept(ModItems.CHALLENGE_ALTAR_ITEM.get());
                        output.accept(ModItems.CHALLENGE_CAGE_ITEM.get());
                        output.accept(ModItems.EMBLEM_BLOCK_ITEM.get());
                        output.accept(ModItems.TOMB_DOOR.get());
                        output.accept(ModItems.SKELETON_KING_SUMMON.get());
                        output.accept(ModItems.SKELETON_KING_REMAINS.get());
                    })
                    .build());
    public static final DeferredRegister<DamageType> DAMAGE_TYPES =
            DeferredRegister.create(Registries.DAMAGE_TYPE, RemainsCaveMod.MODID);
    public static final DeferredHolder<DamageType, DamageType> CRIMSON_BOND_SELF =
            DAMAGE_TYPES.register("crimson_bond_self",
                    () -> new DamageType("crimson_bond_self", 0.1f));
    public static void register(IEventBus eventBus) {
        CREATIVE_MODE_TABS.register(eventBus);
        DAMAGE_TYPES.register(eventBus);
    }

}