package com.tiedup.remake.entities.kidnapper.hosts;

import com.tiedup.remake.entities.EntityKidnapper;
import com.tiedup.remake.entities.KidnapperItemSelector;
import com.tiedup.remake.entities.kidnapper.components.ILootHost;
import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.Nullable;

/**
 * Host implementation for KidnapperLootManager callbacks.
 */
public class LootHost implements ILootHost {

    private final EntityKidnapper entity;

    public LootHost(EntityKidnapper entity) {
        this.entity = entity;
    }

    @Override
    public Level level() {
        return entity.level();
    }

    @Override
    public ItemStack getItemBySlot(EquipmentSlot slot) {
        return entity.getItemBySlot(slot);
    }

    @Override
    public void setItemSlot(EquipmentSlot slot, ItemStack stack) {
        entity.setItemSlot(slot, stack);
    }

    @Override
    public RandomSource getRandom() {
        return entity.getRandom();
    }

    @Override
    @Nullable
    public ItemEntity spawnAtLocation(ItemStack stack) {
        return entity.spawnAtLocation(stack);
    }

    @Override
    public String getNpcName() {
        return entity.getNpcName();
    }

    @Override
    @Nullable
    public KidnapperItemSelector.SelectionResult getItemSelection() {
        return entity.getItemSelection();
    }
}
