/*
 * Copyright (c) 2026 盐灯水母
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

package com.remains_cave.entity;

import com.remains_cave.RemainsCaveMod;
import com.remains_cave.entity.projectile.RuneEntity;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;


import com.remains_cave.entity.projectile.CustomArrowEntity; // 我们下一步要创建的类


import java.util.function.Supplier;

public class ModEntities {
    public static final DeferredRegister<EntityType<?>> ENTITY_TYPES =
            DeferredRegister.create(Registries.ENTITY_TYPE, RemainsCaveMod.MODID);

    public static final Supplier<EntityType<SkeletonWarriorEntity>> SKELETON_WARRIOR =
            ENTITY_TYPES.register("skeleton_warrior",
                    () -> EntityType.Builder.of(SkeletonWarriorEntity::new, MobCategory.MONSTER)
                            .sized(0.6f, 1.99f)
                            .build("skeleton_warrior"));
    public static final Supplier<EntityType<CustomArrowEntity>> TOMB_ARROW = // 改名
            ENTITY_TYPES.register("tomb_arrow", () -> EntityType.Builder.<CustomArrowEntity>of(CustomArrowEntity::new, MobCategory.MISC)
                    .sized(0.5f, 0.5f)
                    .clientTrackingRange(4)
                    .updateInterval(20)
                    .build("tomb_arrow"));
    public static final Supplier<EntityType<SkeletonArcherEntity>> SKELETON_ARCHER =
            ENTITY_TYPES.register("skeleton_archer",
                    () -> EntityType.Builder.of(SkeletonArcherEntity::new, MobCategory.MONSTER)
                            .sized(0.6f, 1.99f) // 尺寸与骷髅战士相同
                            .build("skeleton_archer"));
    public static final Supplier<EntityType<SkeletonWarlockEntity>> SKELETON_WARLOCK =
            ENTITY_TYPES.register("skeleton_warlock",
                    () -> EntityType.Builder.of(SkeletonWarlockEntity::new, MobCategory.MONSTER)
                            .sized(0.6f, 1.99f)
                            .build("skeleton_warlock"));
    public static final Supplier<EntityType<RuneEntity>> RUNE =
            ENTITY_TYPES.register("rune",
                    () -> EntityType.Builder.<RuneEntity>of(RuneEntity::new, MobCategory.MISC)
                            .sized(1.0f, 0.1f)
                            .clientTrackingRange(10)
                            .updateInterval(20)
                            .build("rune"));
    public static final Supplier<EntityType<SkeletonKingEntity>> SKELETON_KING =
            ENTITY_TYPES.register("skeleton_king",
                    () -> EntityType.Builder.of(SkeletonKingEntity::new, MobCategory.MONSTER)
                            .sized(1.5f, 3.0f)
                            .build("skeleton_king"));
}