package com.tiedup.remake.v2.bondage.items;

import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Set;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.LivingEntity;

/**
 * V2 Handcuffs — first V2 bondage item.
 *
 * Occupies ARMS only. Mittens (HANDS) can coexist on top.
 * Uses existing cuffs_prototype.glb for 3D rendering.
 */
public class V2Handcuffs extends AbstractV2BondageItem {

    private static final Set<BodyRegionV2> REGIONS =
        Collections.unmodifiableSet(EnumSet.of(BodyRegionV2.ARMS));

    private static final ResourceLocation MODEL = ResourceLocation.fromNamespaceAndPath(
        TiedUpMod.MOD_ID,
        "models/gltf/v2/handcuffs/cuffs_prototype.glb"
    );

    public V2Handcuffs() {
        super(new Properties().stacksTo(1));
    }

    @Override
    public Set<BodyRegionV2> getOccupiedRegions() {
        return REGIONS;
    }

    @Override
    public ResourceLocation getModelLocation() {
        return MODEL;
    }

    @Override
    public int getPosePriority() {
        return 30;
    }

    @Override
    public int getEscapeDifficulty() {
        return 100;
    }

    @Override
    public String getResistanceId() {
        return "handcuffs";
    }

    @Override
    public void notifyStruggle(LivingEntity entity) {
        entity
            .level()
            .playSound(
                null,
                entity.getX(),
                entity.getY(),
                entity.getZ(),
                net.minecraft.sounds.SoundEvents.CHAIN_STEP,
                net.minecraft.sounds.SoundSource.PLAYERS,
                0.4f,
                1.0f
            );
    }
}
