import { radiusMineCommonBlocks, radiusMineDiamondTier, radiusMineStoneTier, radiusMineIronTier } from 'enums/radiusMine';
import { threeByThreeBreakNorthSouth, threeByThreeBreakEastWest, threeByThreeBreakUpDown } from 'utils/radiusMine';
import { getFacingDirection } from 'utils/vector';
export function diamondTierThreeByThree(componentData) {
    const player = componentData.source;
    if (!player.isSneaking)
        return;
    const blocksToBreak = [
        ...radiusMineCommonBlocks,
        ...radiusMineDiamondTier,
        ...radiusMineStoneTier,
        ...radiusMineIronTier
    ];
    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':
            threeByThreeBreakNorthSouth(block, dimension, blocksToBreak, enchantment);
            break;
        case 'east':
        case 'west':
            threeByThreeBreakEastWest(block, dimension, blocksToBreak, enchantment);
            break;
        case 'up':
        case 'down':
            threeByThreeBreakUpDown(block, dimension, blocksToBreak, enchantment);
            break;
        default:
            break;
    }
}
export function ironTierThreeByThree(componentData) {
    const player = componentData.source;
    if (!player.isSneaking)
        return;
    const blocksToBreak = [
        ...radiusMineCommonBlocks,
        ...radiusMineStoneTier,
        ...radiusMineIronTier
    ];
    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':
            threeByThreeBreakNorthSouth(block, dimension, blocksToBreak, enchantment);
            break;
        case 'east':
        case 'west':
            threeByThreeBreakEastWest(block, dimension, blocksToBreak, enchantment);
            break;
        case 'up':
        case 'down':
            threeByThreeBreakUpDown(block, dimension, blocksToBreak, enchantment);
            break;
        default:
            break;
    }
}
export function stoneTierThreeByThree(componentData) {
    const player = componentData.source;
    if (!player.isSneaking)
        return;
    const blocksToBreak = [
        ...radiusMineCommonBlocks,
        ...radiusMineStoneTier
    ];
    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':
            threeByThreeBreakNorthSouth(block, dimension, blocksToBreak, enchantment);
            break;
        case 'east':
        case 'west':
            threeByThreeBreakEastWest(block, dimension, blocksToBreak, enchantment);
            break;
        case 'up':
        case 'down':
            threeByThreeBreakUpDown(block, dimension, blocksToBreak, enchantment);
            break;
        default:
            break;
    }
}
export function commonTierThreeByThree(componentData) {
    const player = componentData.source;
    if (!player.isSneaking)
        return;
    const blocksToBreak = [...radiusMineCommonBlocks];
    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':
            threeByThreeBreakNorthSouth(block, dimension, blocksToBreak, enchantment);
            break;
        case 'east':
        case 'west':
            threeByThreeBreakEastWest(block, dimension, blocksToBreak, enchantment);
            break;
        case 'up':
        case 'down':
            threeByThreeBreakUpDown(block, dimension, blocksToBreak, enchantment);
            break;
        default:
            break;
    }
}
