package com.tiedup.remake.dispenser;

import com.tiedup.remake.items.clothes.GenericClothes;
import com.tiedup.remake.state.IBondageState;
import com.tiedup.remake.v2.BodyRegionV2;
import net.minecraft.world.item.ItemStack;

/**
 * Dispenser behavior for dressing entities with clothes.
 *
 * Based on original BehaviorDispenserClothes from 1.12.2
 */
public class ClothesDispenseBehavior extends EquipBondageDispenseBehavior {

    @Override
    protected boolean isValidItem(ItemStack stack) {
        return !stack.isEmpty() && stack.getItem() instanceof GenericClothes;
    }

    @Override
    protected boolean canEquip(IBondageState state) {
        return state != null && !state.hasClothes();
    }

    @Override
    protected void equip(IBondageState state, ItemStack stack) {
        if (state != null) {
            state.equip(BodyRegionV2.TORSO, stack);
        }
    }
}
