package org.allaymc.server.container.impl;

import org.allaymc.api.container.Container;
import org.allaymc.api.container.ContainerType;
import org.allaymc.api.container.interfaces.RecipeContainer;
import org.allaymc.api.item.ItemStack;
import org.allaymc.api.item.interfaces.ItemAirStack;

/**
 * @author daoge_cmd
 */
public abstract class CraftingContainerImpl extends BlockContainerImpl implements RecipeContainer {
    public CraftingContainerImpl(ContainerType<? extends Container> containerType) {
        super(containerType);
    }

    protected ItemStack pickOne(int slot) {
        if (isEmpty(slot)) {
            return ItemAirStack.AIR_STACK;
        }

        var copy = getItemStack(slot).copy(false);
        copy.setCount(1);
        return copy;
    }
}
