import { Direction } from '@minecraft/server';
export function getFacingDirection(vector3) {
    let x = vector3.x;
    let y = vector3.y;
    let z = vector3.z;
    if (Math.abs(y) > Math.abs(z) && Math.abs(y) > Math.abs(x)) {
        return y > 0 ? 'up' : 'down';
    }
    else if (Math.abs(z) > Math.abs(x)) {
        return z < 0 ? 'north' : 'south';
    }
    else {
        return x > 0 ? 'east' : 'west';
    }
}
export function directionToVector3(direction) {
    switch (direction) {
        case Direction.Down:
            return { x: 0, y: -1, z: 0 };
        case Direction.Up:
            return { x: 0, y: 1, z: 0 };
        case Direction.North:
            return { x: 0, y: 0, z: -1 };
        case Direction.South:
            return { x: 0, y: 0, z: 1 };
        case Direction.West:
            return { x: -1, y: 0, z: 0 };
        case Direction.East:
            return { x: 1, y: 0, z: 0 };
    }
}
