import { radiusMineCommonBlocks, radiusMineDiamondTier, radiusMineStoneTier, radiusMineIronTier } from 'enums/radiusMine';
import { fiveByFiveBreakNorthSouth, fiveByFiveBreakEastWest, fiveByFiveBreakUpDown } from 'utils/radiusMine';
import { getFacingDirection } from 'utils/vector';
export function diamondTierFiveByFive(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':
            fiveByFiveBreakNorthSouth(block, dimension, blocksToBreak, enchantment);
            break;
        case 'east':
        case 'west':
            fiveByFiveBreakEastWest(block, dimension, blocksToBreak, enchantment);
            break;
        case 'up':
        case 'down':
            fiveByFiveBreakUpDown(block, dimension, blocksToBreak, enchantment);
            break;
        default:
            break;
    }
}
export function ironTierFiveByFive(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':
            fiveByFiveBreakNorthSouth(block, dimension, blocksToBreak, enchantment);
            break;
        case 'east':
        case 'west':
            fiveByFiveBreakEastWest(block, dimension, blocksToBreak, enchantment);
            break;
        case 'up':
        case 'down':
            fiveByFiveBreakUpDown(block, dimension, blocksToBreak, enchantment);
            break;
        default:
            break;
    }
}
export function stoneTierFiveByFive(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':
            fiveByFiveBreakNorthSouth(block, dimension, blocksToBreak, enchantment);
            break;
        case 'east':
        case 'west':
            fiveByFiveBreakEastWest(block, dimension, blocksToBreak, enchantment);
            break;
        case 'up':
        case 'down':
            fiveByFiveBreakUpDown(block, dimension, blocksToBreak, enchantment);
            break;
        default:
            break;
    }
}
export function commonTierFiveByFive(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':
            fiveByFiveBreakNorthSouth(block, dimension, blocksToBreak, enchantment);
            break;
        case 'east':
        case 'west':
            fiveByFiveBreakEastWest(block, dimension, blocksToBreak, enchantment);
            break;
        case 'up':
        case 'down':
            fiveByFiveBreakUpDown(block, dimension, blocksToBreak, enchantment);
            break;
        default:
            break;
    }
}
