package top.r3944realms.eroticdungeongame.content.register;

import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import top.r3944realms.eroticdungeongame.EroticDungeon;
import top.r3944realms.eroticdungeongame.content.device.SeatType;
import top.r3944realms.eroticdungeongame.content.entity.SeatEntity;

public class EDGEntities {
    public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, EroticDungeon.MOD_ID);
    public static final RegistryObject<EntityType<SeatEntity>> CUFF_BED_SEAT = registerSeat(SeatType.CUFF_BED.getBlockName(), SeatEntity::new);

    private static <T extends Entity> RegistryObject<EntityType<T>> registerSeat(String str, EntityType.EntityFactory<T> entityFactory) {
        return ENTITIES.register(str, () -> EntityType.Builder
                .of(entityFactory, MobCategory.MISC)
                .sized(0.0f, 0.0f)
                .updateInterval(4)
                .build(EroticDungeon.rl(str).toString()));
    }
    public static void register(IEventBus eventBus) {
        ENTITIES.register(eventBus);
    }

}
