package com.tiedup.remake.tasks;

import com.tiedup.remake.state.IBondageState;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;

/**
 *
 * Based on original TyingTask from 1.12.2
 *
 * Extends TimedInteractTask with item tracking:
 * - Holds a reference to the bind/gag item being applied
 * - The item will be consumed when tying completes successfully
 */
public abstract class TyingTask extends TimedInteractTask {

    protected ItemStack bind; // The bind/gag item being applied

    /**
     * Create a new tying task.
     *
     * @param bind The bind/gag item to apply
     * @param targetState The target's IBondageState state
     * @param targetEntity The target entity
     * @param seconds Total duration in seconds
     * @param level The world
     */
    public TyingTask(
        ItemStack bind,
        IBondageState targetState,
        LivingEntity targetEntity,
        int seconds,
        Level level
    ) {
        super(targetState, targetEntity, seconds, level);
        this.bind = bind;
    }

    /**
     * Get the bind/gag item being applied.
     *
     * @return The item stack
     */
    public ItemStack getBind() {
        return bind;
    }

    /**
     * Set the bind/gag item.
     *
     * @param bind The item stack
     */
    public void setBind(ItemStack bind) {
        this.bind = bind;
    }
}
