import { Block, BlockPermutation, ItemStack, Player, system } from "@minecraft/server";
import { chestSorterViewMain } from "../../../views/items/chestSorterViews";

/**
 * Evento onUseOn del componente chestSorterComponent
 * Addon: Electrical Creativity BP
 * @param {{blockFace: string, source: Player, usedOnBlockPermutation: BlockPermutation, itemStack: ItemStack, 
 * faceLocation: {x: number, y: number, z: number}, block: Block}} event 
 */
export const chestSorterOnUseOnEvent = ({ blockFace, source, usedOnBlockPermutation, itemStack, faceLocation, block }) => {
    if (block.getComponent('minecraft:inventory') == undefined) return;
    chestSorterViewMain(source, itemStack, block);
}