package com.trunksbomb.minetriad.registry;

import com.trunksbomb.minetriad.MineTriad;
import com.trunksbomb.minetriad.item.CardItem;
import com.trunksbomb.minetriad.item.CardBinderItem;
import com.trunksbomb.minetriad.item.DeckBoxItem;

import net.minecraft.core.component.DataComponents;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.component.ItemContainerContents;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredItem;
import net.neoforged.neoforge.registries.DeferredRegister;

public final class TriadItems {
    private static final Item.Properties DEFAULT_PROPERTIES = new Item.Properties();

    public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(MineTriad.MOD_ID);

    public static final DeferredItem<Item> TRIAD_CARD = ITEMS.register("triad_card", () -> new CardItem(DEFAULT_PROPERTIES.stacksTo(1)));
    public static final DeferredItem<Item> DECK_BOX = ITEMS.register("deck_box", () -> new DeckBoxItem(DEFAULT_PROPERTIES.stacksTo(1)));
    public static final DeferredItem<Item> CARD_BINDER = ITEMS.register(
            "card_binder",
            () -> new CardBinderItem(DEFAULT_PROPERTIES.stacksTo(1).component(DataComponents.CONTAINER, ItemContainerContents.EMPTY)));
    public static final DeferredItem<BlockItem> DUEL_TABLE = ITEMS.registerSimpleBlockItem("duel_table", TriadBlocks.DUEL_TABLE);

    private TriadItems() {
    }

    public static void register(IEventBus eventBus) {
        ITEMS.register(eventBus);
    }
}
