package com.tiedup.remake.v2;

import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.v2.blocks.PetBedBlockEntity;
import com.tiedup.remake.v2.blocks.PetBowlBlockEntity;
import com.tiedup.remake.v2.blocks.PetCageBlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

/**
 * V2 Block Entity Registration.
 */
public class V2BlockEntities {

    public static final DeferredRegister<BlockEntityType<?>> BLOCK_ENTITIES =
        DeferredRegister.create(
            ForgeRegistries.BLOCK_ENTITY_TYPES,
            TiedUpMod.MOD_ID
        );

    public static final RegistryObject<
        BlockEntityType<PetBowlBlockEntity>
    > PET_BOWL = BLOCK_ENTITIES.register("pet_bowl", () ->
        BlockEntityType.Builder.of(
            (pos, state) ->
                new PetBowlBlockEntity(
                    V2BlockEntities.PET_BOWL.get(),
                    pos,
                    state
                ),
            V2Blocks.PET_BOWL.get()
        ).build(null)
    );

    public static final RegistryObject<
        BlockEntityType<PetBedBlockEntity>
    > PET_BED = BLOCK_ENTITIES.register("pet_bed", () ->
        BlockEntityType.Builder.of(
            (pos, state) ->
                new PetBedBlockEntity(
                    V2BlockEntities.PET_BED.get(),
                    pos,
                    state
                ),
            V2Blocks.PET_BED.get()
        ).build(null)
    );

    public static final RegistryObject<
        BlockEntityType<PetCageBlockEntity>
    > PET_CAGE = BLOCK_ENTITIES.register("pet_cage", () ->
        BlockEntityType.Builder.of(
            (pos, state) ->
                new PetCageBlockEntity(
                    V2BlockEntities.PET_CAGE.get(),
                    pos,
                    state
                ),
            V2Blocks.PET_CAGE.get()
        ).build(null)
    );
}
