import { commonBlocks, diamondTier, stoneTier, ironTier } from 'enums/threeByThree';
import { breakNorthSouth, breakEastWest, breakUpDown } from 'utils/threeByThree';
import { getFacingDirection } from 'utils/vector';
export function diamondTierThreeByThree(componentData) {
    const player = componentData.source;
    if (!player.isSneaking)
        return;
    const blocksToBreak = [
        ...commonBlocks,
        ...diamondTier,
        ...stoneTier,
        ...ironTier
    ];
    const minedBlock = componentData.minedBlockPermutation;
    if (!blocksToBreak.includes(minedBlock.type.id))
        return;
    const direction = getFacingDirection(componentData.source.getViewDirection());
    const block = componentData.block;
    const dimension = block.dimension;
    const enchantment = componentData.itemStack.getComponent('enchantable').getEnchantment('silk_touch');
    switch (direction) {
        case 'north':
        case 'south':
            breakNorthSouth(block, dimension, blocksToBreak, enchantment);
            break;
        case 'east':
        case 'west':
            breakEastWest(block, dimension, blocksToBreak, enchantment);
            break;
        case 'up':
        case 'down':
            breakUpDown(block, dimension, blocksToBreak, enchantment);
            break;
        default:
            break;
    }
}
