package top.r3944realms.lib39.example.content.data;

import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.vehicle.Boat;
import net.minecraft.world.entity.vehicle.Minecart;
import net.neoforged.neoforge.capabilities.EntityCapability;
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
import org.jetbrains.annotations.NotNull;
import top.r3944realms.lib39.Lib39;
import top.r3944realms.lib39.util.EntityCapabilityHelper;

/**
 * The type Ex capability handler.
 */
public class ExCapabilityHandler {
    /**
     * The constant TEST_CAP.
     */
    public static final EntityCapability<AbstractedTestSyncData, Void> TEST_CAP = EntityCapability.createVoid(
            Lib39.rl("test_data"),
            AbstractedTestSyncData.class
    );

    /**
     * Register capability.
     *
     * @param event the event
     */
    public static void registerCapability(@NotNull RegisterCapabilitiesEvent event) {
        TestSyncCapProvider provider = new TestSyncCapProvider();
        EntityCapabilityHelper.registerForEntityClass(
                event,
                TEST_CAP,
                provider,
                LivingEntity.class
        );
        EntityCapabilityHelper.registerForEntityClass(
                event,
                TEST_CAP,
                provider,
                Boat.class
        );
        EntityCapabilityHelper.registerForEntityClass(
                event,
                TEST_CAP,
                provider,
                Minecart.class
        );
    }
}
