import { veinMinerStoneTier, veinMinerIronTier, veinMinerDiamondTier } from 'enums/veinMiner';
import { veinMinerWoodenTier } from 'enums/veinMiner';
import { traverseVein } from 'utils/veinMiner';
export function diamondTierVeinMiner(componentData) {
    const player = componentData.source;
    if (!player.isSneaking)
        return;
    const blocksToBreak = [
        ...veinMinerWoodenTier,
        ...veinMinerStoneTier,
        ...veinMinerIronTier,
        ...veinMinerDiamondTier
    ];
    const minedBlock = componentData.minedBlockPermutation;
    if (!blocksToBreak.includes(minedBlock.type.id))
        return;
    const block = componentData.block;
    const dimension = block.dimension;
    const enchantment = componentData.itemStack.getComponent('enchantable').getEnchantment('silk_touch');
    traverseVein(dimension, block, blocksToBreak, 9, enchantment ? true : false);
}
export function ironTierVeinMiner(componentData) {
    const player = componentData.source;
    if (!player.isSneaking)
        return;
    const blocksToBreak = [
        ...veinMinerWoodenTier,
        ...veinMinerStoneTier,
        ...veinMinerIronTier
    ];
    const minedBlock = componentData.minedBlockPermutation;
    if (!blocksToBreak.includes(minedBlock.type.id))
        return;
    const block = componentData.block;
    const dimension = block.dimension;
    const enchantment = componentData.itemStack.getComponent('enchantable').getEnchantment('silk_touch');
    traverseVein(dimension, block, blocksToBreak, 9, enchantment ? true : false);
}
export function stoneTierVeinMiner(componentData) {
    const player = componentData.source;
    if (!player.isSneaking)
        return;
    const blocksToBreak = [
        ...veinMinerWoodenTier,
        ...veinMinerStoneTier
    ];
    const minedBlock = componentData.minedBlockPermutation;
    if (!blocksToBreak.includes(minedBlock.type.id))
        return;
    const block = componentData.block;
    const dimension = block.dimension;
    const enchantment = componentData.itemStack.getComponent('enchantable').getEnchantment('silk_touch');
    traverseVein(dimension, block, blocksToBreak, 9, enchantment ? true : false);
}
export function woodenTierVeinMiner(componentData) {
    const player = componentData.source;
    if (!player.isSneaking)
        return;
    const blocksToBreak = [...veinMinerWoodenTier];
    const minedBlock = componentData.minedBlockPermutation;
    if (!blocksToBreak.includes(minedBlock.type.id))
        return;
    const block = componentData.block;
    const dimension = block.dimension;
    const enchantment = componentData.itemStack.getComponent('enchantable').getEnchantment('silk_touch');
    traverseVein(dimension, block, blocksToBreak, 9, enchantment ? true : false);
}
