package com.trunksbomb.minetriad.registry;

import com.trunksbomb.minetriad.MineTriad;
import com.trunksbomb.minetriad.card.CardStackData;

import net.minecraft.core.component.DataComponentType;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;

public final class TriadDataComponents {
    private static final DeferredRegister.DataComponents COMPONENTS = DeferredRegister.createDataComponents(MineTriad.MOD_ID);

    public static final DeferredHolder<DataComponentType<?>, DataComponentType<CardStackData>> CARD_DATA = COMPONENTS.registerComponentType(
            "card_data",
            builder -> builder.persistent(CardStackData.CODEC).networkSynchronized(CardStackData.STREAM_CODEC));

    private TriadDataComponents() {
    }

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