package com.thebrokenrail.twine.util.backpack.inventory;

import com.thebrokenrail.twine.util.inventory.ItemInventory;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Hand;

public class BackpackInventory extends ItemInventory {
    private final Hand hand;

    public BackpackInventory(int size, PlayerEntity player, Hand hand) {
        super(size, player.getStackInHand(hand));
        this.hand = hand;
    }

    @Override
    public boolean canPlayerUse(PlayerEntity player) {
        return player.getStackInHand(hand) == getHolder();
    }
}
