{"version":3,"sources":["../src/math/Vec3.ts","../src/math/MutVec3.ts","../src/Logging.ts","../src/ChatColor.ts","../src/ColorJSON.ts","../src/math/Vec2.ts","../src/math/MutVec2.ts","../src/Timings.ts","../src/Cache.ts","../src/polyfill/Polyfill.ts","../src/polyfill/PlayerPolyfill.ts","../src/utils/JobUtils.ts","../src/utils/BlockUtils.ts","../src/scheduling/PulseScheduler.ts","../src/scheduling/TaskPulseScheduler.ts","../src/scheduling/UniquePulseScheduler.ts","../src/scheduling/EntityPulseScheduler.ts","../src/scheduling/PlayerPulseScheduler.ts","../src/utils/CommandUtils.ts","../src/VariableSender.ts","../src/vanilla/VanillaBlockTags.ts","../src/vanilla/VanillaItemTags.ts","../src/vanilla/TimeOfDay.ts","../src/utils/DirectionUtils.ts","../src/ColorUtils.ts","../src/utils/EntitySaver.ts","../src/utils/ItemUtils.ts","../src/utils/EntityUtils.ts","../src/TypeAssertion.ts"],"sourcesContent":["import {\r\n    Vector3,\r\n    Direction,\r\n    Vector2,\r\n    StructureRotation,\r\n} from '@minecraft/server';\r\nimport MutVec3 from './MutVec3';\r\nimport { Logger } from '../Logging';\r\n\r\ntype VectorLike = Vector3 | MutVec3 | Vec3 | Direction | number[] | number;\r\n\r\nexport default class Vec3 implements Vector3 {\r\n    private static readonly log = Logger.getLogger(\r\n        'vec3',\r\n        'vec3',\r\n        'bedrock-boost'\r\n    );\r\n    /**\r\n     * Zero vector\r\n     */\r\n    public static readonly Zero = new Vec3(0, 0, 0);\r\n    /**\r\n     * Down vector, negative towards Y\r\n     */\r\n    public static readonly Down = new Vec3(Direction.Down);\r\n    /**\r\n     * Up vector, positive towards Y\r\n     */\r\n    public static readonly Up = new Vec3(Direction.Up);\r\n    /**\r\n     * North vector, negative towards Z\r\n     */\r\n    public static readonly North = new Vec3(Direction.North);\r\n    /**\r\n     * South vector, positive towards Z\r\n     */\r\n    public static readonly South = new Vec3(Direction.South);\r\n    /**\r\n     * East vector, positive towards X\r\n     */\r\n    public static readonly East = new Vec3(Direction.East);\r\n    /**\r\n     * West vector, negative towards X\r\n     */\r\n    public static readonly West = new Vec3(Direction.West);\r\n\r\n    readonly x: number;\r\n    readonly y: number;\r\n    readonly z: number;\r\n    constructor(x: number, y: number, z: number);\r\n    constructor(x: Vec3);\r\n    constructor(x: Vector3);\r\n    constructor(x: Direction);\r\n    constructor(x: number[]);\r\n    constructor(x: VectorLike, y?: number, z?: number) {\r\n        if (x === Direction.Down) {\r\n            this.x = 0;\r\n            this.y = -1;\r\n            this.z = 0;\r\n        } else if (x === Direction.Up) {\r\n            this.x = 0;\r\n            this.y = 1;\r\n            this.z = 0;\r\n        } else if (x === Direction.North) {\r\n            this.x = 0;\r\n            this.y = 0;\r\n            this.z = -1;\r\n        } else if (x === Direction.South) {\r\n            this.x = 0;\r\n            this.y = 0;\r\n            this.z = 1;\r\n        } else if (x === Direction.East) {\r\n            this.x = 1;\r\n            this.y = 0;\r\n            this.z = 0;\r\n        } else if (x === Direction.West) {\r\n            this.x = -1;\r\n            this.y = 0;\r\n            this.z = 0;\r\n        } else if (typeof x === 'number') {\r\n            this.x = x;\r\n            this.y = y!;\r\n            this.z = z!;\r\n        } else if (Array.isArray(x)) {\r\n            this.x = x[0];\r\n            this.y = x[1];\r\n            this.z = x[2];\r\n        } else if (x instanceof Vec3) {\r\n            this.x = x.x;\r\n            this.y = x.y;\r\n            this.z = x.z;\r\n        } else {\r\n            if (\r\n                !x ||\r\n                (!x.x && x.x !== 0) ||\r\n                (!x.y && x.y !== 0) ||\r\n                (!x.z && x.z !== 0)\r\n            ) {\r\n                Vec3.log.error(new Error('Invalid vector'), x);\r\n                throw new Error('Invalid vector');\r\n            }\r\n            this.x = x.x;\r\n            this.y = x.y;\r\n            this.z = x.z;\r\n        }\r\n    }\r\n    /**\r\n     * Creates a new vector from the given values.\r\n     */\r\n    static from(x: number, y: number, z: number): Vec3;\r\n    static from(x: Vec3): Vec3;\r\n    static from(x: Vector3): Vec3;\r\n    static from(x: Direction): Vec3;\r\n    static from(x: number[]): Vec3;\r\n    static from(x: VectorLike, y?: number, z?: number): Vec3 {\r\n        if (x instanceof Vec3) return x;\r\n        if (typeof x === 'number' && y !== undefined && z !== undefined) {\r\n            return new Vec3(x, y, z);\r\n        }\r\n        if (Array.isArray(x)) {\r\n            return new Vec3(x);\r\n        }\r\n        if (x === Direction.Down) return Vec3.Down;\r\n        if (x === Direction.Up) return Vec3.Up;\r\n        if (x === Direction.North) return Vec3.North;\r\n        if (x === Direction.South) return Vec3.South;\r\n        if (x === Direction.East) return Vec3.East;\r\n        if (x === Direction.West) return Vec3.West;\r\n        if (\r\n            !x ||\r\n            (!(x as any).x && (x as any).x !== 0) ||\r\n            (!(x as any).y && (x as any).y !== 0) ||\r\n            (!(x as any).z && (x as any).z !== 0)\r\n        ) {\r\n            Vec3.log.error(new Error('Invalid arguments'), x, y, z);\r\n            throw new Error('Invalid arguments');\r\n        }\r\n        return new Vec3(\r\n            (x as any).x as number,\r\n            (x as any).y as number,\r\n            (x as any).z as number\r\n        );\r\n    }\r\n    private static _from(x: VectorLike, y?: number, z?: number): Vec3 {\r\n        if (typeof x === 'number' && y === undefined && z === undefined) {\r\n            return new Vec3(x, x, x);\r\n        }\r\n        if (x instanceof Vec3) return x;\r\n        if (typeof x === 'number' && y !== undefined && z !== undefined) {\r\n            return new Vec3(x, y, z);\r\n        }\r\n        if (Array.isArray(x)) {\r\n            return new Vec3(x);\r\n        }\r\n        if (x === Direction.Down) return Vec3.Down;\r\n        if (x === Direction.Up) return Vec3.Up;\r\n        if (x === Direction.North) return Vec3.North;\r\n        if (x === Direction.South) return Vec3.South;\r\n        if (x === Direction.East) return Vec3.East;\r\n        if (x === Direction.West) return Vec3.West;\r\n        if (\r\n            !x ||\r\n            (!(x as any).x && (x as any).x !== 0) ||\r\n            (!(x as any).y && (x as any).y !== 0) ||\r\n            (!(x as any).z && (x as any).z !== 0)\r\n        ) {\r\n            Vec3.log.error(new Error('Invalid arguments'), x, y, z);\r\n            throw new Error('Invalid arguments');\r\n        }\r\n        return new Vec3(\r\n            (x as any).x as number,\r\n            (x as any).y as number,\r\n            (x as any).z as number\r\n        );\r\n    }\r\n    /**\r\n     * Creates a copy of the current vector.\r\n     *\r\n     * @returns A new vector with the same values as the current vector.\r\n     */\r\n    copy(): Vec3 {\r\n        return new Vec3(this.x, this.y, this.z);\r\n    }\r\n\r\n    /**\r\n     * Converts this immutable vector to a new mutable vector.\r\n     */\r\n    toMutable(): MutVec3 {\r\n        return new MutVec3(this.x, this.y, this.z);\r\n    }\r\n\r\n    /**\r\n     * Creates a new direction vector from yaw and pitch values.\r\n     *\r\n     * @param rotation - The yaw and pitch values in degrees.\r\n     * @returns A new vector representing the direction.\r\n     */\r\n    static fromRotation(rotation: Vector2): Vec3;\r\n    /**\r\n     * Creates a new direction vector from yaw and pitch values.\r\n     *\r\n     * @param yaw - The yaw value in degrees.\r\n     * @param pitch - The pitch value in degrees.\r\n     * @returns A new vector representing the direction.\r\n     */\r\n    static fromRotation(yaw: number, pitch: number): Vec3;\r\n    static fromRotation(yawOrRotation: number | Vector2, pitch?: number): Vec3 {\r\n        let yaw: number;\r\n        if (typeof yawOrRotation === 'number') {\r\n            yaw = yawOrRotation as number;\r\n            pitch = pitch!;\r\n        } else {\r\n            yaw = yawOrRotation.y;\r\n            pitch = yawOrRotation.x;\r\n        }\r\n        // Convert degrees to radians\r\n        const psi = yaw * (Math.PI / 180);\r\n        const theta = pitch * (Math.PI / 180);\r\n\r\n        const x = -Math.cos(theta) * Math.sin(psi);\r\n        const y = -Math.sin(theta);\r\n        const z = Math.cos(theta) * Math.cos(psi);\r\n        return new Vec3(x, y, z);\r\n    }\r\n\r\n    /**\r\n     * Converts the normal vector to yaw and pitch values.\r\n     *\r\n     * @returns A Vector2 containing the yaw and pitch values.\r\n     */\r\n    toRotation(): Vector2 {\r\n        if (this.isZero()) {\r\n            Vec3.log.error(\r\n                new Error('Cannot convert zero-length vector to direction')\r\n            );\r\n            throw new Error('Cannot convert zero-length vector to direction');\r\n        }\r\n        const direction = this.normalize();\r\n        const yaw = -Math.atan2(direction.x, direction.z) * (180 / Math.PI);\r\n        const pitch = Math.asin(-direction.y) * (180 / Math.PI);\r\n        return {\r\n            x: pitch,\r\n            y: yaw,\r\n        };\r\n    }\r\n\r\n    /**\r\n     * Adds three numbers to the current vector.\r\n     *\r\n     * @param x - The x component to be added.\r\n     * @param y - The y component to be added.\r\n     * @param z - The z component to be added.\r\n     * @returns The updated vector after addition.\r\n     */\r\n    add(x: number, y: number, z: number): Vec3;\r\n\r\n    /**\r\n     * Adds another Vec3 to the current vector.\r\n     *\r\n     * @param x - The Vec3 to be added.\r\n     * @returns The updated vector after addition.\r\n     */\r\n    add(x: Vec3): Vec3;\r\n\r\n    /**\r\n     * Adds another Vector3 to the current vector.\r\n     *\r\n     * @param x - The Vector3 to be added.\r\n     * @returns The updated vector after addition.\r\n     */\r\n    add(x: Vector3): Vec3;\r\n\r\n    /**\r\n     * Adds a Direction to the current vector.\r\n     *\r\n     * @param x - The Direction to be added.\r\n     * @returns The updated vector after addition.\r\n     */\r\n    add(x: Direction): Vec3;\r\n\r\n    /**\r\n     * Adds a Scaler to the current vector.\r\n     *\r\n     * @param x - The Scaler to be added.\r\n     * @returns The updated vector after addition.\r\n     */\r\n    add(x: number): Vec3;\r\n\r\n    /**\r\n     * Adds an array of numbers to the current vector.\r\n     *\r\n     * @param x - The array of numbers to be added.\r\n     * @returns The updated vector after addition.\r\n     */\r\n    add(x: number[]): Vec3;\r\n\r\n    add(x: VectorLike, y?: number, z?: number): Vec3 {\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        return Vec3.from(v.x + this.x, v.y + this.y, v.z + this.z);\r\n    }\r\n\r\n    /**\r\n     * Returns the normalized vector pointing from this vector to the input.\r\n     *\r\n     * @param x - The x component of the target vector.\r\n     * @param y - The y component target vector.\r\n     * @param z - The z component target vector.\r\n     * @returns The direction to the passed in Vector. Equivalent to (B-A).normalized()\r\n     */\r\n    directionTo(x: number, y: number, z: number): Vec3;\r\n\r\n    /**\r\n     * Returns the normalized vector pointing from this vector to the input.\r\n     *\r\n     * @param x - The Vec3 to be added.\r\n     * @returns The direction to the passed in Vector. Equivalent to (B-A).normalized()\r\n     */\r\n    directionTo(x: Vec3): Vec3;\r\n\r\n    /**\r\n     * Returns the normalized vector pointing from this vector to the input.\r\n     *\r\n     * @param x - The Vector3 to be added.\r\n     * @returns The direction to the passed in Vector. Equivalent to (B-A).normalized()\r\n     */\r\n    directionTo(x: Vector3): Vec3;\r\n\r\n    /**\r\n     * Returns the normalized vector pointing from this vector to the input.\r\n     *\r\n     * @param x - The Direction to be added.\r\n     * @returns The direction to the passed in Vector. Equivalent to (B-A).normalized()\r\n     */\r\n    directionTo(x: Direction): Vec3;\r\n\r\n    /**\r\n     * Returns the normalized vector pointing from this vector to the input.\r\n     *\r\n     * @param x - The array of numbers to be added.\r\n     * @returns The direction to the passed in Vector. Equivalent to (B-A).normalized()\r\n     */\r\n    directionTo(x: number[]): Vec3;\r\n\r\n    directionTo(x: VectorLike, y?: number, z?: number) {\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        return v.subtract(this).normalize();\r\n    }\r\n\r\n    /**\r\n     * Subtracts three numbers from the current vector.\r\n     *\r\n     * @param x - The x component to be subtracted.\r\n     * @param y - The y component to be subtracted.\r\n     * @param z - The z component to be subtracted.\r\n     * @returns The updated vector after subtraction.\r\n     */\r\n    subtract(x: number, y: number, z: number): Vec3;\r\n\r\n    /**\r\n     * Subtracts another Vec3 from the current vector.\r\n     *\r\n     * @param x - The Vec3 to be subtracted.\r\n     * @returns The updated vector after subtraction.\r\n     */\r\n    subtract(x: Vec3): Vec3;\r\n\r\n    /**\r\n     * Subtracts a Scaler from the current vector.\r\n     *\r\n     * @param x - The Scaler to be subtracted.\r\n     * @returns The updated vector after subtraction.\r\n     */\r\n    subtract(x: number): Vec3;\r\n\r\n    /**\r\n     * Subtracts another Vector3 from the current vector.\r\n     *\r\n     * @param x - The Vector3 to be subtracted.\r\n     * @returns The updated vector after subtraction.\r\n     */\r\n    subtract(x: Vector3): Vec3;\r\n\r\n    /**\r\n     * Subtracts a Direction from the current vector.\r\n     *\r\n     * @param x - The Direction to be subtracted.\r\n     * @returns The updated vector after subtraction.\r\n     */\r\n    subtract(x: Direction): Vec3;\r\n\r\n    /**\r\n     * Subtracts an array of numbers from the current vector.\r\n     *\r\n     * @param x - The array of numbers to be subtracted.\r\n     * @returns The updated vector after subtraction.\r\n     */\r\n    subtract(x: number[]): Vec3;\r\n\r\n    /**\r\n     * Subtracts a Scaler from the current vector.\r\n     *\r\n     * @param x - The number to be subtracted.\r\n     * @returns The updated vector after subtraction.\r\n     */\r\n    subtract(x: number): Vec3;\r\n\r\n    subtract(x: VectorLike, y?: number, z?: number): Vec3 {\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        return Vec3.from(this.x - v.x, this.y - v.y, this.z - v.z);\r\n    }\r\n\r\n    /**\r\n     * Multiplies the current vector by three numbers.\r\n     *\r\n     * @param x - The multiplier for the x component.\r\n     * @param y - The multiplier for the y component.\r\n     * @param z - The multiplier for the z component.\r\n     * @returns The updated vector after multiplication.\r\n     */\r\n    multiply(x: number, y: number, z: number): Vec3;\r\n\r\n    /**\r\n     * Multiplies the current vector by another Vec3.\r\n     *\r\n     * @param x - The Vec3 multiplier.\r\n     * @returns The updated vector after multiplication.\r\n     */\r\n    multiply(x: Vec3): Vec3;\r\n\r\n    /**\r\n     * Multiplies the current vector by another Vector3.\r\n     *\r\n     * @param x - The Vector3 multiplier.\r\n     * @returns The updated vector after multiplication.\r\n     */\r\n    multiply(x: Vector3): Vec3;\r\n\r\n    /**\r\n     * Multiplies the current vector by a Direction.\r\n     *\r\n     * @param x - The Direction multiplier.\r\n     * @returns The updated vector after multiplication.\r\n     */\r\n    multiply(x: Direction): Vec3;\r\n\r\n    /**\r\n     * Multiplies the current vector by an array of numbers.\r\n     *\r\n     * @param x - The array multiplier.\r\n     * @returns The updated vector after multiplication.\r\n     */\r\n    multiply(x: number[]): Vec3;\r\n\r\n    /**\r\n     * Multiplies the current vector by a scalar.\r\n     *\r\n     * @param x - The scalar multiplier.\r\n     * @returns The updated vector after multiplication.\r\n     */\r\n    multiply(x: number): Vec3;\r\n\r\n    multiply(x: VectorLike, y?: number, z?: number): Vec3 {\r\n        if (typeof x === 'number' && y === undefined && z === undefined) {\r\n            return Vec3.from(this.x * x, this.y * x, this.z * x);\r\n        }\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        return Vec3.from(v.x * this.x, v.y * this.y, v.z * this.z);\r\n    }\r\n\r\n    /**\r\n     * Scales the current vector by a scalar.\r\n     *\r\n     * @param scalar - The scalar to scale the vector by.\r\n     * @returns The updated vector after scaling.\r\n     */\r\n    scale(scalar: number): Vec3 {\r\n        return Vec3.from(this.x * scalar, this.y * scalar, this.z * scalar);\r\n    }\r\n\r\n    /**\r\n     * Divides the current vector by three numbers.\r\n     *\r\n     * @param x - The divisor for the x component.\r\n     * @param y - The divisor for the y component.\r\n     * @param z - The divisor for the z component.\r\n     * @returns The updated vector after division.\r\n     */\r\n    divide(x: number, y: number, z: number): Vec3;\r\n\r\n    /**\r\n     * Divides the current vector by another Vec3.\r\n     *\r\n     * @param x - The Vec3 divisor.\r\n     * @returns The updated vector after division.\r\n     */\r\n    divide(x: Vec3): Vec3;\r\n\r\n    /**\r\n     * Divides the current vector by another Vector3.\r\n     *\r\n     * @param x - The Vector3 divisor.\r\n     * @returns The updated vector after division.\r\n     */\r\n    divide(x: Vector3): Vec3;\r\n\r\n    /**\r\n     * Divides the current vector by a Direction.\r\n     *\r\n     * @param x - The Direction divisor.\r\n     * @returns The updated vector after division.\r\n     */\r\n    divide(x: Direction): Vec3;\r\n\r\n    /**\r\n     * Divides the current vector by an array of numbers.\r\n     *\r\n     * @param x - The array divisor.\r\n     * @returns The updated vector after division.\r\n     */\r\n    divide(x: number[]): Vec3;\r\n\r\n    /**\r\n     * Divides the current vector by a scalar.\r\n     *\r\n     * @param x - The scalar divisor.\r\n     * @returns The updated vector after division.\r\n     */\r\n    divide(x: number): Vec3;\r\n\r\n    divide(x: VectorLike, y?: number, z?: number): Vec3 {\r\n        if (typeof x === 'number' && y === undefined && z === undefined) {\r\n            if (x === 0) throw new Error('Cannot divide by zero');\r\n            return Vec3.from(this.x / x, this.y / x, this.z / x);\r\n        }\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        if (v.x === 0 || v.y === 0 || v.z === 0)\r\n            throw new Error('Cannot divide by zero');\r\n        return Vec3.from(this.x / v.x, this.y / v.y, this.z / v.z);\r\n    }\r\n\r\n    /**\r\n     * Normalizes the vector to have a length (magnitude) of 1.\r\n     * Normalized vectors are often used as a direction vectors.\r\n     *\r\n     * @returns The normalized vector.\r\n     */\r\n    normalize(): Vec3 {\r\n        if (this.isZero()) {\r\n            Vec3.log.error(new Error('Cannot normalize zero-length vector'));\r\n            throw new Error('Cannot normalize zero-length vector');\r\n        }\r\n        const len = this.length();\r\n        return Vec3.from(this.x / len, this.y / len, this.z / len);\r\n    }\r\n\r\n    /**\r\n     * Computes the length (magnitude) of the vector.\r\n     *\r\n     * @returns The length of the vector.\r\n     */\r\n    length(): number {\r\n        return Math.hypot(this.x, this.y, this.z);\r\n    }\r\n    /**\r\n     * Computes the squared length of the vector.\r\n     * This is faster than computing the actual length and can be useful for comparison purposes.\r\n     *\r\n     * @returns The squared length of the vector.\r\n     */\r\n    lengthSquared(): number {\r\n        return this.x * this.x + this.y * this.y + this.z * this.z;\r\n    }\r\n    /**\r\n     * Computes the cross product of the current vector with three numbers.\r\n     *\r\n     * A cross product is a vector that is perpendicular to both vectors.\r\n     *\r\n     * @param x - The x component of the other vector.\r\n     * @param y - The y component of the other vector.\r\n     * @param z - The z component of the other vector.\r\n     * @returns A new vector representing the cross product.\r\n     */\r\n    cross(x: number, y: number, z: number): Vec3;\r\n\r\n    /**\r\n     * Computes the cross product of the current vector with another Vec3.\r\n     *\r\n     * A cross product is a vector that is perpendicular to both vectors.\r\n     *\r\n     * @param x - The Vec3 to be crossed.\r\n     * @returns A new vector representing the cross product.\r\n     */\r\n    cross(x: Vec3): Vec3;\r\n\r\n    /**\r\n     * Computes the cross product of the current vector with another Vector3.\r\n     *\r\n     * A cross product is a vector that is perpendicular to both vectors.\r\n     *\r\n     * @param x - The Vector3 to be crossed.\r\n     * @returns A new vector representing the cross product.\r\n     */\r\n    cross(x: Vector3): Vec3;\r\n\r\n    /**\r\n     * Computes the cross product of the current vector with a Direction.\r\n     *\r\n     * A cross product is a vector that is perpendicular to both vectors.\r\n     *\r\n     * @param x - The Direction to be crossed.\r\n     * @returns A new vector representing the cross product.\r\n     */\r\n    cross(x: Direction): Vec3;\r\n\r\n    /**\r\n     * Computes the cross product of the current vector with an array of numbers.\r\n     *\r\n     * A cross product is a vector that is perpendicular to both vectors.\r\n     *\r\n     * @param x - The array of numbers representing a vector.\r\n     * @returns A new vector representing the cross product.\r\n     */\r\n    cross(x: number[]): Vec3;\r\n\r\n    cross(x: VectorLike, y?: number, z?: number): Vec3 {\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        return Vec3.from(\r\n            this.y * v.z - this.z * v.y,\r\n            this.z * v.x - this.x * v.z,\r\n            this.x * v.y - this.y * v.x\r\n        );\r\n    }\r\n\r\n    /**\r\n     * Computes the distance between the current vector and a vector represented by three numbers.\r\n     *\r\n     * @param x - The x component of the other vector.\r\n     * @param y - The y component of the other vector.\r\n     * @param z - The z component of the other vector.\r\n     * @returns The distance between the two vectors.\r\n     */\r\n    distance(x: number, y: number, z: number): number;\r\n\r\n    /**\r\n     * Computes the distance between the current vector and another Vec3.\r\n     *\r\n     * @param x - The Vec3 to measure the distance to.\r\n     * @returns The distance between the two vectors.\r\n     */\r\n    distance(x: Vec3): number;\r\n\r\n    /**\r\n     * Computes the distance between the current vector and another Vector3.\r\n     *\r\n     * @param x - The Vector3 to measure the distance to.\r\n     * @returns The distance between the two vectors.\r\n     */\r\n    distance(x: Vector3): number;\r\n\r\n    /**\r\n     * Computes the distance between the current vector and a Direction.\r\n     *\r\n     * @param x - The Direction to measure the distance to.\r\n     * @returns The distance between the two vectors.\r\n     */\r\n    distance(x: Direction): number;\r\n\r\n    /**\r\n     * Computes the distance between the current vector and a vector represented by an array of numbers.\r\n     *\r\n     * @param x - The array of numbers representing the other vector.\r\n     * @returns The distance between the two vectors.\r\n     */\r\n    distance(x: number[]): number;\r\n\r\n    distance(x: VectorLike, y?: number, z?: number): number {\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        return this.subtract(v).length();\r\n    }\r\n\r\n    /**\r\n     * Computes the squared distance between the current vector and a vector represented by three numbers.\r\n     * This is faster than computing the actual distance and can be useful for comparison purposes.\r\n     *\r\n     * @param x - The x component of the other vector.\r\n     * @param y - The y component of the other vector.\r\n     * @param z - The z component of the other vector.\r\n     * @returns The squared distance between the two vectors.\r\n     */\r\n    distanceSquared(x: number, y: number, z: number): number;\r\n\r\n    /**\r\n     * Computes the squared distance between the current vector and another Vec3.\r\n     * This is faster than computing the actual distance and can be useful for comparison purposes.\r\n     *\r\n     * @param x - The Vec3 to measure the squared distance to.\r\n     * @returns The squared distance between the two vectors.\r\n     */\r\n    distanceSquared(x: Vec3): number;\r\n\r\n    /**\r\n     * Computes the squared distance between the current vector and another Vector3.\r\n     * This is faster than computing the actual distance and can be useful for comparison purposes.\r\n     *\r\n     * @param x - The Vector3 to measure the squared distance to.\r\n     * @returns The squared distance between the two vectors.\r\n     */\r\n    distanceSquared(x: Vector3): number;\r\n\r\n    /**\r\n     * Computes the squared distance between the current vector and a Direction.\r\n     * This is faster than computing the actual distance and can be useful for comparison purposes.\r\n     *\r\n     * @param x - The Direction to measure the squared distance to.\r\n     * @returns The squared distance between the two vectors.\r\n     */\r\n    distanceSquared(x: Direction): number;\r\n\r\n    /**\r\n     * Computes the squared distance between the current vector and a vector represented by an array of numbers.\r\n     * This is faster than computing the actual distance and can be useful for comparison purposes.\r\n     *\r\n     * @param x - The array of numbers representing the other vector.\r\n     * @returns The squared distance between the two vectors.\r\n     */\r\n    distanceSquared(x: number[]): number;\r\n\r\n    distanceSquared(x: VectorLike, y?: number, z?: number): number {\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        return this.subtract(v).lengthSquared();\r\n    }\r\n\r\n    /**\r\n     * Computes the linear interpolation between the current vector and another vector, when t is in the range [0, 1].\r\n     * Computes the extrapolation when t is outside this range.\r\n     *\r\n     * @param v - The other vector.\r\n     * @param t - The interpolation factor.\r\n     * @returns A new vector after performing the lerp operation.\r\n     */\r\n    lerp(v: Vector3, t: number): Vec3 {\r\n        if (!v || !t) return Vec3.from(this);\r\n        if (t === 1) return Vec3.from(v);\r\n        if (t === 0) return Vec3.from(this);\r\n        return Vec3.from(\r\n            this.x + (v.x - this.x) * t,\r\n            this.y + (v.y - this.y) * t,\r\n            this.z + (v.z - this.z) * t\r\n        );\r\n    }\r\n    /**\r\n     * Computes the spherical linear interpolation between the current vector and another vector, when t is in the range [0, 1].\r\n     * Computes the extrapolation when t is outside this range.\r\n     *\r\n     * @param v - The other vector.\r\n     * @param t - The interpolation factor.\r\n     * @returns A new vector after performing the slerp operation.\r\n     */\r\n    slerp(v: Vector3, t: number): Vec3 {\r\n        if (!v || !t) return Vec3.from(this);\r\n        if (t === 1) return Vec3.from(v);\r\n        if (t === 0) return Vec3.from(this);\r\n        const dot = this.dot(v);\r\n        const theta = Math.acos(dot) * t;\r\n        const relative = Vec3.from(v).subtract(this.multiply(dot)).normalize();\r\n        return this.multiply(Math.cos(theta)).add(\r\n            relative.multiply(Math.sin(theta))\r\n        );\r\n    }\r\n    /**\r\n     * Computes the dot product of the current vector with a vector specified by three numbers.\r\n     *\r\n     * @param x - The x component of the other vector.\r\n     * @param y - The y component of the other vector.\r\n     * @param z - The z component of the other vector.\r\n     * @returns The dot product of the two vectors.\r\n     */\r\n    dot(x: number, y: number, z: number): number;\r\n\r\n    /**\r\n     * Computes the dot product of the current vector with another Vec3.\r\n     *\r\n     * @param x - The Vec3 to compute the dot product with.\r\n     * @returns The dot product of the two vectors.\r\n     */\r\n    dot(x: Vec3): number;\r\n\r\n    /**\r\n     * Computes the dot product of the current vector with another Vector3.\r\n     *\r\n     * @param x - The Vector3 to compute the dot product with.\r\n     * @returns The dot product of the two vectors.\r\n     */\r\n    dot(x: Vector3): number;\r\n\r\n    /**\r\n     * Computes the dot product of the current vector with a Direction.\r\n     *\r\n     * @param x - The Direction to compute the dot product with.\r\n     * @returns The dot product of the two vectors.\r\n     */\r\n    dot(x: Direction): number;\r\n\r\n    /**\r\n     * Computes the dot product of the current vector with a vector represented by an array of numbers.\r\n     *\r\n     * @param x - The array of numbers representing the other vector.\r\n     * @returns The dot product of the two vectors.\r\n     */\r\n    dot(x: number[]): number;\r\n\r\n    dot(x: VectorLike, y?: number, z?: number): number {\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        return this.x * v.x + this.y * v.y + this.z * v.z;\r\n    }\r\n\r\n    /**\r\n     * Computes the angle (in radians) between the current vector and a vector specified by three numbers.\r\n     *\r\n     * @param x - The x component of the other vector.\r\n     * @param y - The y component of the other vector.\r\n     * @param z - The z component of the other vector.\r\n     * @returns The angle in radians between the two vectors.\r\n     */\r\n    angleBetween(x: number, y: number, z: number): number;\r\n\r\n    /**\r\n     * Computes the angle (in radians) between the current vector and another Vec3.\r\n     *\r\n     * @param x - The Vec3 to compute the angle with.\r\n     * @returns The angle in radians between the two vectors.\r\n     */\r\n    angleBetween(x: Vec3): number;\r\n\r\n    /**\r\n     * Computes the angle (in radians) between the current vector and another Vector3.\r\n     *\r\n     * @param x - The Vector3 to compute the angle with.\r\n     * @returns The angle in radians between the two vectors.\r\n     */\r\n    angleBetween(x: Vector3): number;\r\n\r\n    /**\r\n     * Computes the angle (in radians) between the current vector and a Direction.\r\n     *\r\n     * @param x - The Direction to compute the angle with.\r\n     * @returns The angle in radians between the two vectors.\r\n     */\r\n    angleBetween(x: Direction): number;\r\n\r\n    /**\r\n     * Computes the angle (in radians) between the current vector and a vector represented by an array of numbers.\r\n     *\r\n     * @param x - The array of numbers representing the other vector.\r\n     * @returns The angle in radians between the two vectors.\r\n     */\r\n    angleBetween(x: number[]): number;\r\n\r\n    angleBetween(x: VectorLike, y?: number, z?: number): number {\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        const dotProduct = this.dot(v);\r\n        const lenSq1 = this.lengthSquared();\r\n        if (lenSq1 === 0) {\r\n            return 0;\r\n        }\r\n        const lenSq2 = v.lengthSquared();\r\n        if (lenSq2 === 0) {\r\n            return 0;\r\n        }\r\n        const denom = Math.sqrt(lenSq1 * lenSq2);\r\n        // Clamp for numerical stability\r\n        const cosAngle = Math.min(1, Math.max(-1, dotProduct / denom));\r\n        return Math.acos(cosAngle);\r\n    }\r\n\r\n    /**\r\n     * Computes the projection of the current vector onto a vector specified by three numbers.\r\n     * This method finds how much of the current vector lies in the direction of the given vector.\r\n     *\r\n     * @param x - The x component of the vector to project onto.\r\n     * @param y - The y component of the vector to project onto.\r\n     * @param z - The z component of the vector to project onto.\r\n     * @returns A new vector representing the projection of the current vector.\r\n     */\r\n    projectOnto(x: number, y: number, z: number): Vec3;\r\n\r\n    /**\r\n     * Computes the projection of the current vector onto another Vec3.\r\n     * This method finds how much of the current vector lies in the direction of the given vector.\r\n     *\r\n     * @param x - The Vec3 to project onto.\r\n     * @returns A new vector representing the projection of the current vector.\r\n     */\r\n    projectOnto(x: Vec3): Vec3;\r\n\r\n    /**\r\n     * Computes the projection of the current vector onto another Vector3.\r\n     * This method finds how much of the current vector lies in the direction of the given vector.\r\n     *\r\n     * @param x - The Vector3 to project onto.\r\n     * @returns A new vector representing the projection of the current vector.\r\n     */\r\n    projectOnto(x: Vector3): Vec3;\r\n\r\n    /**\r\n     * Computes the projection of the current vector onto a Direction.\r\n     * This method finds how much of the current vector lies in the direction of the given vector.\r\n     *\r\n     * @param x - The Direction to project onto.\r\n     * @returns A new vector representing the projection of the current vector.\r\n     */\r\n    projectOnto(x: Direction): Vec3;\r\n\r\n    /**\r\n     * Computes the projection of the current vector onto a vector represented by an array of numbers.\r\n     * This method finds how much of the current vector lies in the direction of the given vector.\r\n     *\r\n     * @param x - The array of numbers representing the vector to project onto.\r\n     * @returns A new vector representing the projection of the current vector.\r\n     */\r\n    projectOnto(x: number[]): Vec3;\r\n\r\n    projectOnto(x: VectorLike, y?: number, z?: number): Vec3 {\r\n        const v: Vec3 = Vec3._from(x, y, z);\r\n        // If the vector is zero-length, then the projection is the zero vector.\r\n        if (v.isZero()) {\r\n            return Vec3.Zero;\r\n        }\r\n        const denom = v.dot(v);\r\n        if (denom === 0) {\r\n            return Vec3.Zero;\r\n        }\r\n        const scale = this.dot(v) / denom;\r\n        return Vec3.from(v.x * scale, v.y * scale, v.z * scale);\r\n    }\r\n\r\n    /**\r\n     * Computes the reflection of the current vector against a normal vector specified by three numbers.\r\n     * Useful for simulating light reflections or bouncing objects.\r\n     *\r\n     * @param x - The x component of the normal vector.\r\n     * @param y - The y component of the normal vector.\r\n     * @param z - The z component of the normal vector.\r\n     * @returns A new vector representing the reflection of the current vector.\r\n     */\r\n    reflect(x: number, y: number, z: number): Vec3;\r\n\r\n    /**\r\n     * Computes the reflection of the current vector against another Vec3 normal vector.\r\n     * Useful for simulating light reflections or bouncing objects.\r\n     *\r\n     * @param x - The Vec3 representing the normal vector.\r\n     * @returns A new vector representing the reflection of the current vector.\r\n     */\r\n    reflect(x: Vec3): Vec3;\r\n\r\n    /**\r\n     * Computes the reflection of the current vector against another Vector3 normal vector.\r\n     * Useful for simulating light reflections or bouncing objects.\r\n     *\r\n     * @param x - The Vector3 representing the normal vector.\r\n     * @returns A new vector representing the reflection of the current vector.\r\n     */\r\n    reflect(x: Vector3): Vec3;\r\n\r\n    /**\r\n     * Computes the reflection of the current vector against a Direction normal vector.\r\n     * Useful for simulating light reflections or bouncing objects.\r\n     *\r\n     * @param x - The Direction representing the normal vector.\r\n     * @returns A new vector representing the reflection of the current vector.\r\n     */\r\n    reflect(x: Direction): Vec3;\r\n\r\n    /**\r\n     * Computes the reflection of the current vector against a normal vector represented by an array of numbers.\r\n     * Useful for simulating light reflections or bouncing objects.\r\n     *\r\n     * @param x - The array of numbers representing the normal vector.\r\n     * @returns A new vector representing the reflection of the current vector.\r\n     */\r\n    reflect(x: number[]): Vec3;\r\n\r\n    reflect(x: VectorLike, y?: number, z?: number): Vec3 {\r\n        const normal: Vec3 = Vec3._from(x, y, z);\r\n        const proj = this.projectOnto(normal);\r\n        return this.subtract(proj.multiply(2));\r\n    }\r\n\r\n    /**\r\n     * Rotates the current normalized vector by a given angle around a given axis.\r\n     *\r\n     * @param axis - The axis of rotation.\r\n     * @param angle - The angle of rotation in degrees.\r\n     * @returns The rotated vector.\r\n     */\r\n    rotate(axis: Vector3, angle: number): Vec3 {\r\n        // Convert angle from degrees to radians and compute half angle\r\n        const halfAngle = (angle * Math.PI) / 180 / 2;\r\n\r\n        // Quaternion representing the rotation\r\n        const w = Math.cos(halfAngle);\r\n        const x = axis.x * Math.sin(halfAngle);\r\n        const y = axis.y * Math.sin(halfAngle);\r\n        const z = axis.z * Math.sin(halfAngle);\r\n        // eslint-disable-next-line @typescript-eslint/no-this-alias\r\n        const v = this;\r\n\r\n        // Rotate vector (v) using quaternion\r\n        // Simplified direct computation reflecting quaternion rotation and its conjugate effect\r\n        const qv_x =\r\n            w * w * v.x +\r\n            2 * y * w * v.z -\r\n            2 * z * w * v.y +\r\n            x * x * v.x +\r\n            2 * y * x * v.y +\r\n            2 * z * x * v.z -\r\n            z * z * v.x -\r\n            y * y * v.x;\r\n        const qv_y =\r\n            2 * x * y * v.x +\r\n            y * y * v.y +\r\n            2 * z * y * v.z +\r\n            2 * w * z * v.x -\r\n            z * z * v.y +\r\n            w * w * v.y -\r\n            2 * x * w * v.z -\r\n            x * x * v.y;\r\n        const qv_z =\r\n            2 * x * z * v.x +\r\n            2 * y * z * v.y +\r\n            z * z * v.z -\r\n            2 * w * y * v.x -\r\n            y * y * v.z +\r\n            2 * w * x * v.y -\r\n            x * x * v.z +\r\n            w * w * v.z;\r\n\r\n        return new Vec3(qv_x, qv_y, qv_z);\r\n    }\r\n    /**\r\n     * Updates the X, Y, and Z components of the vector.\r\n     *\r\n     * @param x - The function to use to update the X value.\r\n     * @param y - The function to use to update the Y value.\r\n     * @param z - The function to use to update the Z value.\r\n     * @returns The updated vector with the new values.\r\n     */\r\n    update(\r\n        x: ((x: number) => number) | undefined,\r\n        y: ((y: number) => number) | undefined,\r\n        z: ((z: number) => number) | undefined\r\n    ): Vec3 {\r\n        if (!x) {\r\n            x = (value: number) => value;\r\n        }\r\n        if (!y) {\r\n            y = (value: number) => value;\r\n        }\r\n        if (!z) {\r\n            z = (value: number) => value;\r\n        }\r\n        return new Vec3(x(this.x), y(this.y), z(this.z));\r\n    }\r\n    /**\r\n     * Sets the X component of the vector.\r\n     *\r\n     * @param value - The new X value.\r\n     * @returns The updated vector with the new X value.\r\n     */\r\n    setX(value: number): Vec3;\r\n    setX(value: (x: number) => number): Vec3;\r\n    setX(value: number | ((x: number) => number)): Vec3 {\r\n        if (typeof value === 'number') {\r\n            return new Vec3(value, this.y, this.z);\r\n        }\r\n        return new Vec3(value(this.x), this.y, this.z);\r\n    }\r\n    /**\r\n     * Sets the Y component of the vector.\r\n     *\r\n     * @param value - The new Y value.\r\n     * @returns The updated vector with the new Y value.\r\n     */\r\n    setY(value: number): Vec3;\r\n    setY(value: (y: number) => number): Vec3;\r\n    setY(value: number | ((y: number) => number)): Vec3 {\r\n        if (typeof value === 'number') {\r\n            return new Vec3(this.x, value, this.z);\r\n        }\r\n        return new Vec3(this.x, value(this.y), this.z);\r\n    }\r\n    /**\r\n     * Sets the Z component of the vector.\r\n     *\r\n     * @param value - The new Z value.\r\n     * @returns The updated vector with the new Z value.\r\n     */\r\n    setZ(value: number): Vec3;\r\n    setZ(value: (z: number) => number): Vec3;\r\n    setZ(value: number | ((z: number) => number)): Vec3 {\r\n        if (typeof value === 'number') {\r\n            return new Vec3(this.x, this.y, value);\r\n        }\r\n        return new Vec3(this.x, this.y, value(this.z));\r\n    }\r\n    /**\r\n     * Calculates the shortest distance between a point (represented by this Vector3 instance) and a line segment.\r\n     *\r\n     * This method finds the perpendicular projection of the point onto the line defined by the segment. If this\r\n     * projection lies outside the line segment, then the method calculates the distance from the point to the\r\n     * nearest segment endpoint.\r\n     *\r\n     * @param start - The starting point of the line segment.\r\n     * @param end - The ending point of the line segment.\r\n     * @returns The shortest distance between the point and the line segment.\r\n     */\r\n    distanceToLineSegment(start: Vector3, end: Vector3): number {\r\n        const lineDirection = Vec3.from(end).subtract(start);\r\n        // If the line is zero-length, then the distance is the distance to the start point.\r\n        if (lineDirection.lengthSquared() === 0) {\r\n            return this.subtract(start).length();\r\n        }\r\n        const t = Math.max(\r\n            0,\r\n            Math.min(\r\n                1,\r\n                this.subtract(start).dot(lineDirection) /\r\n                    lineDirection.dot(lineDirection)\r\n            )\r\n        );\r\n        const projection = Vec3.from(start).add(lineDirection.multiply(t));\r\n        return this.subtract(projection).length();\r\n    }\r\n    /**\r\n     * Floors the X, Y, and Z components of the vector.\r\n     * @returns A new vector with the floored components.\r\n     */\r\n    floor(): Vec3 {\r\n        return this.update(Math.floor, Math.floor, Math.floor);\r\n    }\r\n    /**\r\n     * Floors the X component of the vector.\r\n     * @returns A new vector with the floored X component.\r\n     */\r\n    floorX(): Vec3 {\r\n        return this.setX(Math.floor);\r\n    }\r\n    /**\r\n     * Floors the Y component of the vector.\r\n     * @returns A new vector with the floored Y component.\r\n     */\r\n    floorY(): Vec3 {\r\n        return this.setY(Math.floor);\r\n    }\r\n    /**\r\n     * Floors the Z component of the vector.\r\n     * @returns A new vector with the floored Z component.\r\n     */\r\n    floorZ(): Vec3 {\r\n        return this.setZ(Math.floor);\r\n    }\r\n    /**\r\n     * Ceils the X, Y, and Z components of the vector.\r\n     * @returns A new vector with the ceiled components.\r\n     */\r\n    ceil(): Vec3 {\r\n        return new Vec3(\r\n            Math.ceil(this.x),\r\n            Math.ceil(this.y),\r\n            Math.ceil(this.z)\r\n        );\r\n    }\r\n    /**\r\n     * Ceils the X component of the vector.\r\n     * @returns A new vector with the ceiled X component.\r\n     */\r\n    ceilX(): Vec3 {\r\n        return this.setX(Math.ceil);\r\n    }\r\n    /**\r\n     * Ceils the Y component of the vector.\r\n     * @returns A new vector with the ceiled Y component.\r\n     */\r\n    ceilY(): Vec3 {\r\n        return this.setY(Math.ceil);\r\n    }\r\n    /**\r\n     * Ceils the Z component of the vector.\r\n     * @returns A new vector with the ceiled Z component.\r\n     */\r\n    ceilZ(): Vec3 {\r\n        return this.setZ(Math.ceil);\r\n    }\r\n    /**\r\n     * Rounds the X, Y, and Z components of the vector.\r\n     * @returns A new vector with the rounded components.\r\n     */\r\n    round(): Vec3 {\r\n        return this.update(Math.round, Math.round, Math.round);\r\n    }\r\n    /**\r\n     * Rounds the X component of the vector.\r\n     * @returns A new vector with the rounded X component.\r\n     */\r\n    roundX(): Vec3 {\r\n        return this.setX(Math.round);\r\n    }\r\n    /**\r\n     * Rounds the Y component of the vector.\r\n     * @returns A new vector with the rounded Y component.\r\n     */\r\n    roundY(): Vec3 {\r\n        return this.setY(Math.round);\r\n    }\r\n    /**\r\n     * Rounds the Z component of the vector.\r\n     * @returns A new vector with the rounded Z component.\r\n     */\r\n    roundZ(): Vec3 {\r\n        return this.setZ(Math.round);\r\n    }\r\n    /**\r\n     * Returns a new vector offset from the current vector up by 1 block.\r\n     * @returns A new vector offset from the current vector up by 1 block.\r\n     */\r\n    up(): Vec3 {\r\n        return this.add(Vec3.Up);\r\n    }\r\n    /**\r\n     * Returns a new vector offset from the current vector down by 1 block.\r\n     * @returns A new vector offset from the current vector down by 1 block.\r\n     */\r\n    down(): Vec3 {\r\n        return this.add(Vec3.Down);\r\n    }\r\n    /**\r\n     * Returns a new vector offset from the current vector north by 1 block.\r\n     * @returns A new vector offset from the current vector north by 1 block.\r\n     */\r\n    north(): Vec3 {\r\n        return this.add(Vec3.North);\r\n    }\r\n    /**\r\n     * Returns a new vector offset from the current vector south by 1 block.\r\n     * @returns A new vector offset from the current vector south by 1 block.\r\n     */\r\n    south(): Vec3 {\r\n        return this.add(Vec3.South);\r\n    }\r\n    /**\r\n     * Returns a new vector offset from the current vector east by 1 block.\r\n     * @returns A new vector offset from the current vector east by 1 block.\r\n     */\r\n    east(): Vec3 {\r\n        return this.add(Vec3.East);\r\n    }\r\n    /**\r\n     * Returns a new vector offset from the current vector west by 1 block.\r\n     * @returns A new vector offset from the current vector west by 1 block.\r\n     */\r\n    west(): Vec3 {\r\n        return this.add(Vec3.West);\r\n    }\r\n    /**\r\n     * Checks if the current vector is equal to the zero vector.\r\n     * @returns true if the vector is equal to the zero vector, else returns false.\r\n     */\r\n    isZero(): boolean {\r\n        return this.x === 0 && this.y === 0 && this.z === 0;\r\n    }\r\n    /**\r\n     * Converts the vector to an array containing the X, Y, and Z components of the vector.\r\n     * @returns An array containing the X, Y, and Z components of the vector.\r\n     */\r\n    toArray(): number[] {\r\n        return [this.x, this.y, this.z];\r\n    }\r\n    /**\r\n     * Converts the vector to a direction.\r\n     * If the vector is not a unit vector, then it will be normalized and rounded to the nearest direction.\r\n     */\r\n    toDirection(): Direction {\r\n        if (this.isZero()) {\r\n            Vec3.log.error(\r\n                new Error('Cannot convert zero-length vector to direction')\r\n            );\r\n            throw new Error('Cannot convert zero-length vector to direction');\r\n        }\r\n        const normalized = this.normalize();\r\n        const maxValue = Math.max(\r\n            Math.abs(normalized.x),\r\n            Math.abs(normalized.y),\r\n            Math.abs(normalized.z)\r\n        );\r\n        if (maxValue === normalized.x) return Direction.East;\r\n        if (maxValue === -normalized.x) return Direction.West;\r\n        if (maxValue === normalized.y) return Direction.Up;\r\n        if (maxValue === -normalized.y) return Direction.Down;\r\n        if (maxValue === normalized.z) return Direction.South;\r\n        if (maxValue === -normalized.z) return Direction.North;\r\n        // This should never happen\r\n        Vec3.log.error(new Error('Cannot convert vector to direction'), this);\r\n        throw new Error('Cannot convert vector to direction');\r\n    }\r\n    /**\r\n     * Converts the vector to a structure rotation.\r\n     * If the vector is not a unit vector, then it will be normalized and rounded to the nearest 90 degrees rotation.\r\n     */\r\n    toStructureRotation(): StructureRotation {\r\n        const rotation = this.toRotation();\r\n        let aligned = Math.round(rotation.y / 90) * 90;\r\n        if (aligned < 0) {\r\n            aligned += 360;\r\n        }\r\n        if (aligned >= 360) {\r\n            aligned -= 360;\r\n        }\r\n        if (aligned === 0) return StructureRotation.None;\r\n        if (aligned === 90) return StructureRotation.Rotate90;\r\n        if (aligned === 180) return StructureRotation.Rotate180;\r\n        if (aligned === 270) return StructureRotation.Rotate270;\r\n        // This should never happen\r\n        Vec3.log.error(\r\n            new Error('Cannot convert vector to structure rotation'),\r\n            this\r\n        );\r\n        throw new Error('Cannot convert vector to structure rotation');\r\n    }\r\n    /**\r\n     * Returns a new vector with the X, Y, and Z components rounded to the nearest block location.\r\n     */\r\n    toBlockLocation(): Vec3 {\r\n        // At this point I'm not sure if it wouldn't be better to use Math.floor instead\r\n        return Vec3.from(\r\n            (this.x << 0) - (this.x < 0 && this.x !== this.x << 0 ? 1 : 0),\r\n            (this.y << 0) - (this.y < 0 && this.y !== this.y << 0 ? 1 : 0),\r\n            (this.z << 0) - (this.z < 0 && this.z !== this.z << 0 ? 1 : 0)\r\n        );\r\n    }\r\n    /**\r\n     * Checks if the current vector is almost equal to another vector defined by three numbers,\r\n     * within a given tolerance (delta).\r\n     *\r\n     * @param x - The x component of the other vector.\r\n     * @param y - The y component of the other vector.\r\n     * @param z - The z component of the other vector.\r\n     * @param delta - The maximum allowed difference between corresponding components.\r\n     * @returns True if the vectors are almost equal; otherwise, false.\r\n     */\r\n    almostEqual(x: number, y: number, z: number, delta: number): boolean;\r\n\r\n    /**\r\n     * Checks if the current vector is almost equal to another Vec3 within a given tolerance (delta).\r\n     *\r\n     * @param x - The Vec3 to compare.\r\n     * @param delta - The maximum allowed difference between corresponding components.\r\n     * @returns True if the vectors are almost equal; otherwise, false.\r\n     */\r\n    almostEqual(x: Vec3, delta: number): boolean;\r\n\r\n    /**\r\n     * Checks if the current vector is almost equal to another Vector3 within a given tolerance (delta).\r\n     *\r\n     * @param x - The Vector3 to compare.\r\n     * @param delta - The maximum allowed difference between corresponding components.\r\n     * @returns True if the vectors are almost equal; otherwise, false.\r\n     */\r\n    almostEqual(x: Vector3, delta: number): boolean;\r\n\r\n    /**\r\n     * Checks if the current vector is almost equal to a Direction within a given tolerance (delta).\r\n     *\r\n     * @param x - The Direction to compare.\r\n     * @param delta - The maximum allowed difference between corresponding components.\r\n     * @returns True if the vectors are almost equal; otherwise, false.\r\n     */\r\n    almostEqual(x: Direction, delta: number): boolean;\r\n\r\n    /**\r\n     * Checks if the current vector is almost equal to a vector represented by an array of numbers,\r\n     * within a given tolerance (delta).\r\n     *\r\n     * @param x - The array of numbers representing the vector.\r\n     * @param delta - The maximum allowed difference between corresponding components.\r\n     * @returns True if the vectors are almost equal; otherwise, false.\r\n     */\r\n    almostEqual(x: number[], delta: number): boolean;\r\n\r\n    almostEqual(x: VectorLike, y: number, z?: number, delta?: number): boolean {\r\n        try {\r\n            let other: Vec3;\r\n            if (typeof x !== 'number' && z === undefined) {\r\n                other = Vec3._from(x, undefined, undefined);\r\n                delta = y!;\r\n            } else {\r\n                other = Vec3._from(x, y, z);\r\n            }\r\n            return (\r\n                Math.abs(this.x - other.x) <= delta! &&\r\n                Math.abs(this.y - other.y) <= delta! &&\r\n                Math.abs(this.z - other.z) <= delta!\r\n            );\r\n        } catch (e) {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Checks if the current vector is exactly equal to another vector defined by three numbers.\r\n     *\r\n     * @param x - The x component of the other vector.\r\n     * @param y - The y component of the other vector.\r\n     * @param z - The z component of the other vector.\r\n     * @returns True if the vectors are exactly equal; otherwise, false.\r\n     */\r\n    equals(x: number, y: number, z: number): boolean;\r\n\r\n    /**\r\n     * Checks if the current vector is exactly equal to another Vec3.\r\n     *\r\n     * @param x - The Vec3 to compare.\r\n     * @returns True if the vectors are exactly equal; otherwise, false.\r\n     */\r\n    equals(x: Vec3): boolean;\r\n\r\n    /**\r\n     * Checks if the current vector is exactly equal to another Vector3.\r\n     *\r\n     * @param x - The Vector3 to compare.\r\n     * @returns True if the vectors are exactly equal; otherwise, false.\r\n     */\r\n    equals(x: Vector3): boolean;\r\n\r\n    /**\r\n     * Checks if the current vector is exactly equal to a Direction.\r\n     *\r\n     * @param x - The Direction to compare.\r\n     * @returns True if the vectors are exactly equal; otherwise, false.\r\n     */\r\n    equals(x: Direction): boolean;\r\n\r\n    /**\r\n     * Checks if the current vector is exactly equal to a vector represented by an array of numbers.\r\n     *\r\n     * @param x - The array of numbers representing the vector.\r\n     * @returns True if the vectors are exactly equal; otherwise, false.\r\n     */\r\n    equals(x: number[]): boolean;\r\n\r\n    equals(x: VectorLike, y?: number, z?: number): boolean {\r\n        try {\r\n            const other: Vec3 = Vec3._from(x, y, z);\r\n            return (\r\n                this.x === other.x && this.y === other.y && this.z === other.z\r\n            );\r\n        } catch (e) {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Converts the vector to a string representation.\r\n     *\r\n     * @param format - The format of the string representation. Defaults to \"long\".\r\n     * @param separator - The separator to use between components. Defaults to \", \".\r\n     * @returns The string representation of the vector.\r\n     * @remarks\r\n     * The \"long\" format is \"Vec3(x, y, z)\".\r\n     * The \"short\" format is \"x, y, z\".\r\n     */\r\n    toString(\r\n        format: 'long' | 'short' = 'long',\r\n        separator: string = ', '\r\n    ): string {\r\n        const result = `${this.x + separator + this.y + separator + this.z}`;\r\n        return format === 'long' ? `Vec3(${result})` : result;\r\n    }\r\n\r\n    /**\r\n     * Parses a string representation of a vector.\r\n     *\r\n     * @param str - The string representation of the vector.\r\n     * @param format - The format of the string representation. Defaults to \"long\".\r\n     * @param separator - The separator to use between components. Defaults to \", \".\r\n     * @returns The vector parsed from the string.\r\n     * @throws {Error} If the string format is invalid.\r\n     */\r\n    static fromString(\r\n        str: string,\r\n        format: 'long' | 'short' = 'long',\r\n        separator: string = ', '\r\n    ): Vec3 {\r\n        if (format === 'long') {\r\n            const match = str.match(/^Vec3\\((.*)\\)$/);\r\n            if (!match) {\r\n                throw new Error('Invalid string format');\r\n            }\r\n            const components = match[1].split(separator);\r\n            if (components.length !== 3) {\r\n                throw new Error('Invalid string format');\r\n            }\r\n            return Vec3.from(\r\n                Number(components[0]),\r\n                Number(components[1]),\r\n                Number(components[2])\r\n            );\r\n        } else {\r\n            const components = str.split(separator);\r\n            if (components.length !== 3) {\r\n                throw new Error('Invalid string format');\r\n            }\r\n            return Vec3.from(\r\n                Number(components[0]),\r\n                Number(components[1]),\r\n                Number(components[2])\r\n            );\r\n        }\r\n    }\r\n}\r\n","import {\r\n    Vector2,\r\n    Vector3,\r\n    Direction,\r\n    StructureRotation,\r\n} from '@minecraft/server';\r\nimport Vec3 from './Vec3';\r\n\r\n// Matches Vec3 constructor flexibility, but this class is mutable and all ops mutate `this`.\r\ntype VectorLike = Vector3 | Vec3 | MutVec3 | Direction | number[] | number;\r\n\r\nexport default class MutVec3 implements Vector3 {\r\n    x: number;\r\n    y: number;\r\n    z: number;\r\n\r\n    constructor(x: number, y: number, z: number);\r\n    constructor(x: MutVec3);\r\n    constructor(x: Vec3);\r\n    constructor(x: Vector3);\r\n    constructor(x: Direction);\r\n    constructor(x: number[]);\r\n    constructor(x: VectorLike, y?: number, z?: number) {\r\n        if (x === Direction.Down) {\r\n            this.x = 0;\r\n            this.y = -1;\r\n            this.z = 0;\r\n        } else if (x === Direction.Up) {\r\n            this.x = 0;\r\n            this.y = 1;\r\n            this.z = 0;\r\n        } else if (x === Direction.North) {\r\n            this.x = 0;\r\n            this.y = 0;\r\n            this.z = -1;\r\n        } else if (x === Direction.South) {\r\n            this.x = 0;\r\n            this.y = 0;\r\n            this.z = 1;\r\n        } else if (x === Direction.East) {\r\n            this.x = 1;\r\n            this.y = 0;\r\n            this.z = 0;\r\n        } else if (x === Direction.West) {\r\n            this.x = -1;\r\n            this.y = 0;\r\n            this.z = 0;\r\n        } else if (typeof x === 'number') {\r\n            this.x = x;\r\n            this.y = y!;\r\n            this.z = z!;\r\n        } else if (Array.isArray(x)) {\r\n            this.x = x[0];\r\n            this.y = x[1];\r\n            this.z = x[2];\r\n        } else if (x instanceof MutVec3 || x instanceof Vec3) {\r\n            this.x = x.x;\r\n            this.y = x.y;\r\n            this.z = x.z;\r\n        } else {\r\n            if (\r\n                !x ||\r\n                (!(x as any).x && (x as any).x !== 0) ||\r\n                (!(x as any).y && (x as any).y !== 0) ||\r\n                (!(x as any).z && (x as any).z !== 0)\r\n            ) {\r\n                throw new Error('Invalid vector');\r\n            }\r\n            this.x = (x as any).x;\r\n            this.y = (x as any).y;\r\n            this.z = (x as any).z;\r\n        }\r\n    }\r\n\r\n    static from(x: number, y: number, z: number): MutVec3;\r\n    static from(x: MutVec3): MutVec3;\r\n    static from(x: Vec3): MutVec3;\r\n    static from(x: Vector3): MutVec3;\r\n    static from(x: Direction): MutVec3;\r\n    static from(x: number[]): MutVec3;\r\n    static from(x: VectorLike, y?: number, z?: number): MutVec3 {\r\n        if (x instanceof MutVec3) return new MutVec3(x);\r\n        if (typeof x === 'number' && y !== undefined && z !== undefined)\r\n            return new MutVec3(x, y, z);\r\n        if (Array.isArray(x)) return new MutVec3(x);\r\n        if (x === Direction.Down) return new MutVec3(Direction.Down);\r\n        if (x === Direction.Up) return new MutVec3(Direction.Up);\r\n        if (x === Direction.North) return new MutVec3(Direction.North);\r\n        if (x === Direction.South) return new MutVec3(Direction.South);\r\n        if (x === Direction.East) return new MutVec3(Direction.East);\r\n        if (x === Direction.West) return new MutVec3(Direction.West);\r\n        if (\r\n            !x ||\r\n            (!(x as any).x && (x as any).x !== 0) ||\r\n            (!(x as any).y && (x as any).y !== 0) ||\r\n            (!(x as any).z && (x as any).z !== 0)\r\n        ) {\r\n            throw new Error('Invalid arguments');\r\n        }\r\n        return new MutVec3(\r\n            (x as any).x as number,\r\n            (x as any).y as number,\r\n            (x as any).z as number\r\n        );\r\n    }\r\n\r\n    private static _from(x: VectorLike, y?: number, z?: number): MutVec3 {\r\n        if (typeof x === 'number' && y === undefined && z === undefined) {\r\n            return new MutVec3(x, x, x)\r\n        }\r\n\r\n        if (x instanceof MutVec3) return x;\r\n        if (typeof x === 'number' && y !== undefined && z !== undefined)\r\n            return new MutVec3(x, y, z);\r\n        if (Array.isArray(x)) return new MutVec3(x);\r\n        if (x === Direction.Down) return new MutVec3(Direction.Down);\r\n        if (x === Direction.Up) return new MutVec3(Direction.Up);\r\n        if (x === Direction.North) return new MutVec3(Direction.North);\r\n        if (x === Direction.South) return new MutVec3(Direction.South);\r\n        if (x === Direction.East) return new MutVec3(Direction.East);\r\n        if (x === Direction.West) return new MutVec3(Direction.West);\r\n        if (\r\n            !x ||\r\n            (!(x as any).x && (x as any).x !== 0) ||\r\n            (!(x as any).y && (x as any).y !== 0) ||\r\n            (!(x as any).z && (x as any).z !== 0)\r\n        ) {\r\n            throw new Error('Invalid arguments');\r\n        }\r\n        return new MutVec3(\r\n            (x as any).x as number,\r\n            (x as any).y as number,\r\n            (x as any).z as number\r\n        );\r\n    }\r\n\r\n    copy() {\r\n        return new MutVec3(this.x, this.y, this.z);\r\n    }\r\n\r\n    toImmutable() {\r\n        return new Vec3(this.x, this.y, this.z);\r\n    }\r\n\r\n    static fromRotation(rotation: Vector2): MutVec3;\r\n    static fromRotation(yaw: number, pitch: number): MutVec3;\r\n    static fromRotation(\r\n        yawOrRotation: number | Vector2,\r\n        pitch?: number\r\n    ): MutVec3 {\r\n        let yaw: number;\r\n        if (typeof yawOrRotation === 'number') {\r\n            yaw = yawOrRotation as number;\r\n            pitch = pitch!;\r\n        } else {\r\n            yaw = yawOrRotation.y;\r\n            pitch = yawOrRotation.x;\r\n        }\r\n        const psi = yaw * (Math.PI / 180);\r\n        const theta = pitch * (Math.PI / 180);\r\n        const x = -Math.cos(theta) * Math.sin(psi);\r\n        const yv = -Math.sin(theta);\r\n        const z = Math.cos(theta) * Math.cos(psi);\r\n        return new MutVec3(x, yv, z);\r\n    }\r\n\r\n    toRotation() {\r\n        if (this.isZero())\r\n            throw new Error('Cannot convert zero-length vector to direction');\r\n        const dir = this.copy().normalize();\r\n        const yaw = -Math.atan2(dir.x, dir.z) * (180 / Math.PI);\r\n        const pitch = Math.asin(-dir.y) * (180 / Math.PI);\r\n        return { x: pitch, y: yaw };\r\n    }\r\n\r\n    add(x: number, y: number, z: number): MutVec3;\r\n    add(x: Vector3): MutVec3;\r\n    add(x: Vec3): MutVec3;\r\n    add(x: MutVec3): MutVec3;\r\n    add(x: Direction): MutVec3;\r\n    add(x: number[]): MutVec3;\r\n    add(x: number): MutVec3;\r\n    add(x: VectorLike, y?: number, z?: number): MutVec3 {\r\n        const v = MutVec3._from(x, y, z);\r\n        this.x += v.x;\r\n        this.y += v.y;\r\n        this.z += v.z;\r\n        return this;\r\n    }\r\n\r\n    directionTo(x: number, y: number, z: number): MutVec3;\r\n    directionTo(x: Vector3): MutVec3;\r\n    directionTo(x: Vec3): MutVec3;\r\n    directionTo(x: MutVec3): MutVec3;\r\n    directionTo(x: Direction): MutVec3;\r\n    directionTo(x: number[]): MutVec3;\r\n    directionTo(x: VectorLike, y?: number, z?: number): MutVec3 {\r\n        const v = MutVec3._from(x, y, z);\r\n        this.subtract(v).multiply(-1).normalize();\r\n        return this;\r\n    }\r\n\r\n    subtract(x: number, y: number, z: number): MutVec3;\r\n    subtract(x: Vector3): MutVec3;\r\n    subtract(x: Vec3): MutVec3;\r\n    subtract(x: MutVec3): MutVec3;\r\n    subtract(x: Direction): MutVec3;\r\n    subtract(x: number[]): MutVec3;\r\n    subtract(x: number): MutVec3;\r\n    subtract(x: VectorLike, y?: number, z?: number): MutVec3 {\r\n        const v = MutVec3._from(x, y, z);\r\n        this.x -= v.x;\r\n        this.y -= v.y;\r\n        this.z -= v.z;\r\n        return this;\r\n    }\r\n\r\n    multiply(x: number, y: number, z: number): MutVec3;\r\n    multiply(x: Vector3): MutVec3;\r\n    multiply(x: Vec3): MutVec3;\r\n    multiply(x: MutVec3): MutVec3;\r\n    multiply(x: Direction): MutVec3;\r\n    multiply(x: number[]): MutVec3;\r\n    multiply(x: number): MutVec3;\r\n    multiply(x: VectorLike, y?: number, z?: number): MutVec3 {\r\n        const v = MutVec3._from(x, y, z);\r\n        this.x *= v.x;\r\n        this.y *= v.y;\r\n        this.z *= v.z;\r\n        return this;\r\n    }\r\n\r\n    scale(scalar: number) {\r\n        this.x *= scalar;\r\n        this.y *= scalar;\r\n        this.z *= scalar;\r\n        return this;\r\n    }\r\n\r\n    divide(x: number, y: number, z: number): MutVec3;\r\n    divide(x: Vector3): MutVec3;\r\n    divide(x: Vec3): MutVec3;\r\n    divide(x: MutVec3): MutVec3;\r\n    divide(x: Direction): MutVec3;\r\n    divide(x: number[]): MutVec3;\r\n    divide(x: number): MutVec3;\r\n    divide(x: VectorLike, y?: number, z?: number): MutVec3 {\r\n        if (typeof x === 'number' && y === undefined && z === undefined) {\r\n            if (x === 0) throw new Error('Cannot divide by zero');\r\n            this.x /= x;\r\n            this.y /= x;\r\n            this.z /= x;\r\n            return this;\r\n        }\r\n        const v = MutVec3._from(x, y, z);\r\n        if (v.x === 0 || v.y === 0 || v.z === 0)\r\n            throw new Error('Cannot divide by zero');\r\n        this.x /= v.x;\r\n        this.y /= v.y;\r\n        this.z /= v.z;\r\n        return this;\r\n    }\r\n\r\n    normalize() {\r\n        if (this.isZero())\r\n            throw new Error('Cannot normalize zero-length vector');\r\n        const len = this.length();\r\n        this.x /= len;\r\n        this.y /= len;\r\n        this.z /= len;\r\n        return this;\r\n    }\r\n\r\n    length() {\r\n        return Math.hypot(this.x, this.y, this.z);\r\n    }\r\n\r\n    lengthSquared() {\r\n        return this.x * this.x + this.y * this.y + this.z * this.z;\r\n    }\r\n\r\n    cross(x: number, y: number, z: number): MutVec3;\r\n    cross(x: Vector3): MutVec3;\r\n    cross(x: Vec3): MutVec3;\r\n    cross(x: MutVec3): MutVec3;\r\n    cross(x: Direction): MutVec3;\r\n    cross(x: number[]): MutVec3;\r\n    cross(x: VectorLike, y?: number, z?: number): MutVec3 {\r\n        const v = MutVec3._from(x, y, z);\r\n        const cx = this.y * v.z - this.z * v.y;\r\n        const cy = this.z * v.x - this.x * v.z;\r\n        const cz = this.x * v.y - this.y * v.x;\r\n        this.x = cx;\r\n        this.y = cy;\r\n        this.z = cz;\r\n        return this;\r\n    }\r\n\r\n    distance(x: number, y: number, z: number): number;\r\n    distance(x: Vector3): number;\r\n    distance(x: Vec3): number;\r\n    distance(x: MutVec3): number;\r\n    distance(x: Direction): number;\r\n    distance(x: number[]): number;\r\n    distance(x: VectorLike, y?: number, z?: number) {\r\n        const v = MutVec3._from(x, y, z);\r\n        return this.copy().subtract(v).length();\r\n    }\r\n\r\n    distanceSquared(x: number, y: number, z: number): number;\r\n    distanceSquared(x: Vector3): number;\r\n    distanceSquared(x: Vec3): number;\r\n    distanceSquared(x: MutVec3): number;\r\n    distanceSquared(x: Direction): number;\r\n    distanceSquared(x: number[]): number;\r\n    distanceSquared(x: VectorLike, y?: number, z?: number) {\r\n        const v = MutVec3._from(x, y, z);\r\n        return this.copy().subtract(v).lengthSquared();\r\n    }\r\n\r\n    lerp(v: Vector3, t: number) {\r\n        if (!v || t === undefined) return this;\r\n        if (t === 1) {\r\n            this.x = v.x;\r\n            this.y = v.y;\r\n            this.z = v.z;\r\n            return this;\r\n        }\r\n        if (t === 0) return this;\r\n        this.x = this.x + (v.x - this.x) * t;\r\n        this.y = this.y + (v.y - this.y) * t;\r\n        this.z = this.z + (v.z - this.z) * t;\r\n        return this;\r\n    }\r\n\r\n    slerp(v: Vector3, t: number) {\r\n        if (!v || t === undefined) return this;\r\n        if (t === 1) {\r\n            this.x = v.x;\r\n            this.y = v.y;\r\n            this.z = v.z;\r\n            return this;\r\n        }\r\n        if (t === 0) return this;\r\n        const dot = this.dot(v);\r\n        const theta = Math.acos(dot) * t;\r\n        const relative = MutVec3.from(v)\r\n            .subtract(this.copy().multiply(dot))\r\n            .normalize();\r\n        const cosT = Math.cos(theta);\r\n        const sinT = Math.sin(theta);\r\n        // this = this * cosT + relative * sinT\r\n        this.multiply(cosT);\r\n        this.x += relative.x * sinT;\r\n        this.y += relative.y * sinT;\r\n        this.z += relative.z * sinT;\r\n        return this;\r\n    }\r\n\r\n    dot(x: number, y: number, z: number): number;\r\n    dot(x: Vector3): number;\r\n    dot(x: Vec3): number;\r\n    dot(x: MutVec3): number;\r\n    dot(x: Direction): number;\r\n    dot(x: number[]): number;\r\n    dot(x: VectorLike, y?: number, z?: number) {\r\n        const v = MutVec3._from(x, y, z);\r\n        return this.x * v.x + this.y * v.y + this.z * v.z;\r\n    }\r\n\r\n    angleBetween(x: number, y: number, z: number): number;\r\n    angleBetween(x: Vector3): number;\r\n    angleBetween(x: Vec3): number;\r\n    angleBetween(x: MutVec3): number;\r\n    angleBetween(x: Direction): number;\r\n    angleBetween(x: number[]): number;\r\n    angleBetween(x: VectorLike, y?: number, z?: number) {\r\n        const v = MutVec3._from(x, y, z);\r\n        const dotProduct = this.dot(v);\r\n        const lenSq1 = this.lengthSquared();\r\n        if (lenSq1 === 0) return 0;\r\n        const lenSq2 = v.lengthSquared();\r\n        if (lenSq2 === 0) return 0;\r\n        const denom = Math.sqrt(lenSq1 * lenSq2);\r\n        const cosAngle = Math.min(1, Math.max(-1, dotProduct / denom));\r\n        return Math.acos(cosAngle);\r\n    }\r\n\r\n    projectOnto(x: number, y: number, z: number): MutVec3;\r\n    projectOnto(x: Vector3): MutVec3;\r\n    projectOnto(x: Vec3): MutVec3;\r\n    projectOnto(x: MutVec3): MutVec3;\r\n    projectOnto(x: Direction): MutVec3;\r\n    projectOnto(x: number[]): MutVec3;\r\n    projectOnto(x: VectorLike, y?: number, z?: number): MutVec3 {\r\n        const v = MutVec3._from(x, y, z);\r\n        if (v.isZero()) {\r\n            this.x = 0;\r\n            this.y = 0;\r\n            this.z = 0;\r\n            return this;\r\n        }\r\n        const denom = v.dot(v);\r\n        if (denom === 0) {\r\n            this.x = 0;\r\n            this.y = 0;\r\n            this.z = 0;\r\n            return this;\r\n        }\r\n        const scale = this.dot(v) / denom;\r\n        this.x = v.x * scale;\r\n        this.y = v.y * scale;\r\n        this.z = v.z * scale;\r\n        return this;\r\n    }\r\n\r\n    reflect(x: number, y: number, z: number): MutVec3;\r\n    reflect(x: Vector3): MutVec3;\r\n    reflect(x: Vec3): MutVec3;\r\n    reflect(x: MutVec3): MutVec3;\r\n    reflect(x: Direction): MutVec3;\r\n    reflect(x: number[]): MutVec3;\r\n    reflect(x: VectorLike, y?: number, z?: number): MutVec3 {\r\n        const normal = MutVec3._from(x, y, z);\r\n        const tmp = this.copy();\r\n        const proj = tmp.projectOnto(normal);\r\n        return this.subtract(proj.multiply(2));\r\n    }\r\n\r\n    rotate(axis: Vector3, angle: number) {\r\n        const halfAngle = (angle * Math.PI) / 180 / 2;\r\n        const w = Math.cos(halfAngle);\r\n        const x = axis.x * Math.sin(halfAngle);\r\n        const y = axis.y * Math.sin(halfAngle);\r\n        const z = axis.z * Math.sin(halfAngle);\r\n        const vx = this.x,\r\n            vy = this.y,\r\n            vz = this.z;\r\n        const qv_x =\r\n            w * w * vx +\r\n            2 * y * w * vz -\r\n            2 * z * w * vy +\r\n            x * x * vx +\r\n            2 * y * x * vy +\r\n            2 * z * x * vz -\r\n            z * z * vx -\r\n            y * y * vx;\r\n        const qv_y =\r\n            2 * x * y * vx +\r\n            y * y * vy +\r\n            2 * z * y * vz +\r\n            2 * w * z * vx -\r\n            z * z * vy +\r\n            w * w * vy -\r\n            2 * x * w * vz -\r\n            x * x * vy;\r\n        const qv_z =\r\n            2 * x * z * vx +\r\n            2 * y * z * vy +\r\n            z * z * vz -\r\n            2 * w * y * vx -\r\n            y * y * vz +\r\n            2 * w * x * vy -\r\n            x * x * vz +\r\n            w * w * vz;\r\n        this.x = qv_x;\r\n        this.y = qv_y;\r\n        this.z = qv_z;\r\n        return this;\r\n    }\r\n\r\n    update(\r\n        x: ((x: number) => number) | undefined,\r\n        y: ((y: number) => number) | undefined,\r\n        z: ((z: number) => number) | undefined\r\n    ) {\r\n        if (!x) x = (v: number) => v;\r\n        if (!y) y = (v: number) => v;\r\n        if (!z) z = (v: number) => v;\r\n        this.x = x(this.x);\r\n        this.y = y(this.y);\r\n        this.z = z(this.z);\r\n        return this;\r\n    }\r\n\r\n    setX(value: number): MutVec3;\r\n    setX(value: (x: number) => number): MutVec3;\r\n    setX(value: number | ((x: number) => number)): MutVec3 {\r\n        if (typeof value === 'number') this.x = value;\r\n        else this.x = value(this.x);\r\n        return this;\r\n    }\r\n\r\n    setY(value: number): MutVec3;\r\n    setY(value: (y: number) => number): MutVec3;\r\n    setY(value: number | ((y: number) => number)): MutVec3 {\r\n        if (typeof value === 'number') this.y = value;\r\n        else this.y = value(this.y);\r\n        return this;\r\n    }\r\n\r\n    setZ(value: number): MutVec3;\r\n    setZ(value: (z: number) => number): MutVec3;\r\n    setZ(value: number | ((z: number) => number)): MutVec3 {\r\n        if (typeof value === 'number') this.z = value;\r\n        else this.z = value(this.z);\r\n        return this;\r\n    }\r\n\r\n    floor() {\r\n        return this.update(Math.floor, Math.floor, Math.floor);\r\n    }\r\n    floorX() {\r\n        return this.setX(Math.floor);\r\n    }\r\n    floorY() {\r\n        return this.setY(Math.floor);\r\n    }\r\n    floorZ() {\r\n        return this.setZ(Math.floor);\r\n    }\r\n\r\n    ceil() {\r\n        return this.update(Math.ceil, Math.ceil, Math.ceil);\r\n    }\r\n    ceilX() {\r\n        return this.setX(Math.ceil);\r\n    }\r\n    ceilY() {\r\n        return this.setY(Math.ceil);\r\n    }\r\n    ceilZ() {\r\n        return this.setZ(Math.ceil);\r\n    }\r\n\r\n    round() {\r\n        return this.update(Math.round, Math.round, Math.round);\r\n    }\r\n    roundX() {\r\n        return this.setX(Math.round);\r\n    }\r\n    roundY() {\r\n        return this.setY(Math.round);\r\n    }\r\n    roundZ() {\r\n        return this.setZ(Math.round);\r\n    }\r\n\r\n    up() {\r\n        return this.add(Direction.Up);\r\n    }\r\n    down() {\r\n        return this.add(Direction.Down);\r\n    }\r\n    north() {\r\n        return this.add(Direction.North);\r\n    }\r\n    south() {\r\n        return this.add(Direction.South);\r\n    }\r\n    east() {\r\n        return this.add(Direction.East);\r\n    }\r\n    west() {\r\n        return this.add(Direction.West);\r\n    }\r\n\r\n    isZero() {\r\n        return this.x === 0 && this.y === 0 && this.z === 0;\r\n    }\r\n\r\n    toArray() {\r\n        return [this.x, this.y, this.z];\r\n    }\r\n\r\n    toDirection() {\r\n        if (this.isZero())\r\n            throw new Error('Cannot convert zero-length vector to direction');\r\n        const normalized = this.copy().normalize();\r\n        const maxValue = Math.max(\r\n            Math.abs(normalized.x),\r\n            Math.abs(normalized.y),\r\n            Math.abs(normalized.z)\r\n        );\r\n        if (maxValue === normalized.x) return Direction.East;\r\n        if (maxValue === -normalized.x) return Direction.West;\r\n        if (maxValue === normalized.y) return Direction.Up;\r\n        if (maxValue === -normalized.y) return Direction.Down;\r\n        if (maxValue === normalized.z) return Direction.South;\r\n        if (maxValue === -normalized.z) return Direction.North;\r\n        throw new Error('Cannot convert vector to direction');\r\n    }\r\n\r\n    toStructureRotation() {\r\n        const rotation = this.toRotation();\r\n        let aligned = Math.round(rotation.y / 90) * 90;\r\n        if (aligned < 0) aligned += 360;\r\n        if (aligned >= 360) aligned -= 360;\r\n        if (aligned === 0) return StructureRotation.None;\r\n        if (aligned === 90) return StructureRotation.Rotate90;\r\n        if (aligned === 180) return StructureRotation.Rotate180;\r\n        if (aligned === 270) return StructureRotation.Rotate270;\r\n        throw new Error('Cannot convert vector to structure rotation');\r\n    }\r\n\r\n    toBlockLocation() {\r\n        this.x = (this.x << 0) - (this.x < 0 && this.x !== this.x << 0 ? 1 : 0);\r\n        this.y = (this.y << 0) - (this.y < 0 && this.y !== this.y << 0 ? 1 : 0);\r\n        this.z = (this.z << 0) - (this.z < 0 && this.z !== this.z << 0 ? 1 : 0);\r\n        return this;\r\n    }\r\n\r\n    almostEqual(x: number, y: number, z: number, delta: number): boolean;\r\n    almostEqual(x: MutVec3, delta: number): boolean;\r\n    almostEqual(x: Vec3, delta: number): boolean;\r\n    almostEqual(x: Vector3, delta: number): boolean;\r\n    almostEqual(x: Direction, delta: number): boolean;\r\n    almostEqual(x: number[], delta: number): boolean;\r\n    almostEqual(x: VectorLike, y: number, z?: number, delta?: number) {\r\n        try {\r\n            let other: MutVec3;\r\n            if (typeof x !== 'number' && z === undefined) {\r\n                other = MutVec3._from(x, undefined, undefined);\r\n                delta = y!;\r\n            } else {\r\n                other = MutVec3._from(x, y, z);\r\n            }\r\n            return (\r\n                Math.abs(this.x - other.x) <= delta! &&\r\n                Math.abs(this.y - other.y) <= delta! &&\r\n                Math.abs(this.z - other.z) <= delta!\r\n            );\r\n        } catch (e) {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    equals(x: number, y: number, z: number): boolean;\r\n    equals(x: MutVec3): boolean;\r\n    equals(x: Vec3): boolean;\r\n    equals(x: Vector3): boolean;\r\n    equals(x: Direction): boolean;\r\n    equals(x: number[]): boolean;\r\n    equals(x: VectorLike, y?: number, z?: number) {\r\n        try {\r\n            const other = MutVec3._from(x, y, z);\r\n            return (\r\n                this.x === other.x && this.y === other.y && this.z === other.z\r\n            );\r\n        } catch (e) {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    toString(format: 'long' | 'short' = 'long', separator: string = ', ') {\r\n        const result = `${this.x + separator + this.y + separator + this.z}`;\r\n        return format === 'long' ? `MutVec3(${result})` : result;\r\n    }\r\n\r\n    static fromString(\r\n        str: string,\r\n        format: 'long' | 'short' = 'long',\r\n        separator: string = ', '\r\n    ) {\r\n        if (format === 'long') {\r\n            const match = str.match(/^MutVec3\\((.*)\\)$/);\r\n            if (!match) throw new Error('Invalid string format');\r\n            const components = match[1].split(separator);\r\n            if (components.length !== 3)\r\n                throw new Error('Invalid string format');\r\n            return new MutVec3(\r\n                Number(components[0]),\r\n                Number(components[1]),\r\n                Number(components[2])\r\n            );\r\n        } else {\r\n            const components = str.split(separator);\r\n            if (components.length !== 3)\r\n                throw new Error('Invalid string format');\r\n            return new MutVec3(\r\n                Number(components[0]),\r\n                Number(components[1]),\r\n                Number(components[2])\r\n            );\r\n        }\r\n    }\r\n}\r\n","/* eslint-disable no-unused-labels */\r\nimport { system, world } from '@minecraft/server';\r\nimport ChatColor from './ChatColor';\r\nimport ColorJSON from './ColorJSON';\r\n\r\nlet sourceMapping: any = void 0;\r\ntry {\r\n    sourceMapping = globalSourceMapping;\r\n} catch (e) {\r\n    // Ignore\r\n}\r\n\r\n/**\r\n * The `OutputType` enum defines the various types of outputs that the logger can use.\r\n */\r\nexport enum OutputType {\r\n    /**\r\n     * Uses `world.sendMessage` to send the log message to the chat.\r\n     */\r\n    Chat,\r\n    /**\r\n     * Uses `console.log` to send the log message to the console.\r\n     */\r\n    ConsoleInfo,\r\n    /**\r\n     * Uses `console.warn` to send the log message to the console as a warning.\r\n     */\r\n    ConsoleWarn,\r\n    /**\r\n     * Uses `console.error` to send the log message to the console as an error.\r\n     */\r\n    ConsoleError,\r\n}\r\n\r\n/**\r\n * The `LogLevel` class defines the various logging levels used by the logger.\r\n */\r\nexport class LogLevel {\r\n    static All: LogLevel = new LogLevel(-2, 'all');\r\n    static Trace: LogLevel = new LogLevel(-2, 'trace', ChatColor.DARK_AQUA);\r\n    static Debug: LogLevel = new LogLevel(-1, 'debug', ChatColor.AQUA);\r\n    static Info: LogLevel = new LogLevel(0, 'info', ChatColor.GREEN);\r\n    static Warn: LogLevel = new LogLevel(1, 'warn', ChatColor.GOLD);\r\n    static Error: LogLevel = new LogLevel(2, 'error', ChatColor.RED);\r\n    static Fatal: LogLevel = new LogLevel(3, 'fatal', ChatColor.DARK_RED);\r\n    static Off: LogLevel = new LogLevel(100, 'off');\r\n\r\n    /**\r\n     * The list of all available log levels.\r\n     */\r\n    static values = [\r\n        LogLevel.All,\r\n        LogLevel.Trace,\r\n        LogLevel.Debug,\r\n        LogLevel.Info,\r\n        LogLevel.Warn,\r\n        LogLevel.Error,\r\n        LogLevel.Fatal,\r\n        LogLevel.Off,\r\n    ];\r\n\r\n    /**\r\n     * The constructor for each log level.\r\n     *\r\n     * @param {number} level - The numerical level for this logger.\r\n     * @param {string} name - The string name for this logger.\r\n     * @param {ChatColor} color - The color to use for this logger. Defaults to `ChatColor.RESET`.\r\n     */\r\n    private constructor(\r\n        public readonly level: number,\r\n        public readonly name: string,\r\n        public color: ChatColor = ChatColor.RESET\r\n    ) {}\r\n\r\n    /**\r\n     * Return the logging level as a string.\r\n     *\r\n     * @returns {string} The string representation of the logging level.\r\n     */\r\n    public toString(): string {\r\n        return this.color + this.name.toUpperCase() + ChatColor.RESET;\r\n    }\r\n\r\n    /**\r\n     * Parse a string to get the corresponding `LogLevel`.\r\n     *\r\n     * @param {string} str - The string to parse.\r\n     * @returns {LogLevel} The corresponding `LogLevel`, or `undefined` if none was found.\r\n     */\r\n    static parse(str: string): LogLevel | undefined {\r\n        str = str.toLowerCase();\r\n        for (const level of LogLevel.values) {\r\n            if (level.name === str) return level;\r\n        }\r\n        // check if it is a number\r\n        const num = parseInt(str);\r\n        if (!isNaN(num)) {\r\n            for (const level of LogLevel.values) {\r\n                if (level.level === num) return level;\r\n            }\r\n        }\r\n        return undefined;\r\n    }\r\n}\r\n\r\n/**\r\n * The `OutputConfig` type defines the configuration for the logger's outputs.\r\n * It is a mapping of `LogLevel` to an array of `OutputType`.\r\n */\r\nexport type OutputConfig = {\r\n    [key in LogLevel['level']]?: OutputType[];\r\n};\r\n\r\n/**\r\n * Function to match the provided string to the given pattern.\r\n *\r\n * @param {string} pattern - The pattern to match.\r\n * @param {string} str - The string to match the pattern against.\r\n * @returns {boolean} return true if the pattern matches, else returns false.\r\n */\r\nfunction starMatch(pattern: string, str: string): boolean {\r\n    if (pattern === '*') return true;\r\n    if (pattern.includes('*')) {\r\n        if (pattern.startsWith('*')) {\r\n            return str.endsWith(pattern.substring(1));\r\n        }\r\n        if (pattern.endsWith('*')) {\r\n            return str.startsWith(pattern.substring(0, pattern.length - 1));\r\n        }\r\n        const regex = new RegExp(pattern.replace(/\\*/g, '.*'));\r\n        return regex.test(str);\r\n    }\r\n    return pattern === str;\r\n}\r\n\r\ntype LoggingSettings = {\r\n    filter: '*' | string[];\r\n    level: LogLevel;\r\n    outputTags: boolean;\r\n    timestampFormatter: (timestamp: Date) => string;\r\n    formatFunction: (\r\n        level: LogLevel,\r\n        logger: Logger,\r\n        message: string,\r\n        timestamp: string,\r\n        tags?: string[] | undefined\r\n    ) => string;\r\n    messagesJoinFunction: (messages: string[]) => string;\r\n    jsonFormatter: ColorJSON;\r\n    outputConfig: OutputConfig;\r\n};\r\n\r\nconst loggingSettings: LoggingSettings = {\r\n    level: LogLevel.Info,\r\n    filter: ['*'],\r\n    outputTags: false,\r\n    timestampFormatter: (timestamp: Date) => {\r\n        // Hidden by default\r\n        return '';\r\n    },\r\n    formatFunction: (\r\n        level: LogLevel,\r\n        logger: Logger,\r\n        message: string,\r\n        timestamp: string,\r\n        tags = undefined\r\n    ) => {\r\n        const _tags =\r\n            tags !== undefined\r\n                ? `§7${tags.map((tag) => `[${tag}]`).join('')}§r`\r\n                : '';\r\n        const time = timestamp ? `[${timestamp}]` : '';\r\n        return `${time}[${level}][${ChatColor.MATERIAL_EMERALD}${logger.name}${ChatColor.RESET}]${_tags} ${message}`;\r\n    },\r\n    messagesJoinFunction: (messages: string[]) => {\r\n        return messages.join(' ');\r\n    },\r\n    jsonFormatter: ColorJSON.DEFAULT,\r\n    outputConfig: {\r\n        [LogLevel.Trace.level]: [OutputType.Chat, OutputType.ConsoleInfo],\r\n        [LogLevel.Debug.level]: [OutputType.Chat, OutputType.ConsoleInfo],\r\n        [LogLevel.Info.level]: [OutputType.Chat, OutputType.ConsoleInfo],\r\n        [LogLevel.Warn.level]: [\r\n            OutputType.Chat,\r\n            OutputType.ConsoleInfo,\r\n            OutputType.ConsoleWarn,\r\n        ],\r\n        [LogLevel.Error.level]: [\r\n            OutputType.Chat,\r\n            OutputType.ConsoleInfo,\r\n            OutputType.ConsoleError,\r\n        ],\r\n        [LogLevel.Fatal.level]: [\r\n            OutputType.Chat,\r\n            OutputType.ConsoleInfo,\r\n            OutputType.ConsoleError,\r\n        ],\r\n    },\r\n};\r\n\r\n/**\r\n * The Logger class.\r\n */\r\nexport class Logger {\r\n    private static initialized: boolean = false;\r\n    /**\r\n     *  Initialize logger class\r\n     */\r\n    static init() {\r\n        LOGGING: {\r\n            if (Logger.initialized) return;\r\n            Logger.initialized = true;\r\n            system.beforeEvents.startup.subscribe(() => {\r\n                system.afterEvents.scriptEventReceive.subscribe((ev) => {\r\n                    if (ev.id === 'logging:level' || ev.id === 'log:level') {\r\n                        if (!ev.message) {\r\n                            loggingSettings.level = LogLevel.Info;\r\n                            world.sendMessage(\r\n                                `${ChatColor.AQUA}Logging level set to ${ChatColor.BOLD}${loggingSettings.level}`\r\n                            );\r\n                        } else {\r\n                            const level = LogLevel.parse(ev.message);\r\n                            if (level) {\r\n                                loggingSettings.level = level;\r\n                                world.sendMessage(\r\n                                    `${ChatColor.AQUA}Logging level set to ${ChatColor.BOLD}${loggingSettings.level}`\r\n                                );\r\n                            } else {\r\n                                world.sendMessage(\r\n                                    `${ChatColor.DARK_RED}Invalid logging level: ${ev.message}`\r\n                                );\r\n                            }\r\n                        }\r\n                    } else if (\r\n                        ev.id === 'logging:filter' ||\r\n                        ev.id === 'log:filter'\r\n                    ) {\r\n                        if (!ev.message) {\r\n                            loggingSettings.filter = ['*'];\r\n                        } else {\r\n                            loggingSettings.filter = ev.message.split(',');\r\n                        }\r\n                        world.sendMessage(\r\n                            `${ChatColor.AQUA}Logging filter set to ${\r\n                                ChatColor.BOLD\r\n                            }${loggingSettings.filter.join(', ')}`\r\n                        );\r\n                    }\r\n                });\r\n            });\r\n        }\r\n    }\r\n    /**\r\n     * @param {LogLevel} level - The level to set.\r\n     */\r\n    static setLevel(level: LogLevel) {\r\n        loggingSettings.level = level;\r\n    }\r\n    /**\r\n     * Filter the loggers by the given tags. Tags can use the `*` wildcard.\r\n     * @param {'*' | string[]} filter - The filter to set.\r\n     */\r\n    static setFilter(filter: '*' | string[]) {\r\n        loggingSettings.filter = filter;\r\n    }\r\n    /**\r\n     * Set the format function for the logger.\r\n     * @param {function} func - The function to set.\r\n     */\r\n    static setFormatFunction(\r\n        func: (\r\n            level: LogLevel,\r\n            logger: Logger,\r\n            message: string,\r\n            timestamp: string,\r\n            tags?: string[] | undefined\r\n        ) => string\r\n    ) {\r\n        loggingSettings.formatFunction = func;\r\n    }\r\n    /**\r\n     * Set the function, that joins multiple messages into one for the logger.\r\n     * @param {function} func - The function to set.\r\n     */\r\n    static setMessagesJoinFunction(func: (messages: string[]) => string) {\r\n        loggingSettings.messagesJoinFunction = func;\r\n    }\r\n    /**\r\n     * Set the tag visibility for the logger. When true, tags will be printed in the log. Disabled by default.\r\n     * @param visible\r\n     */\r\n    static setTagsOutputVisibility(visible: boolean) {\r\n        loggingSettings.outputTags = visible;\r\n    }\r\n    /**\r\n     * Set the timestamp formatter for the logger.\r\n     * @param formatter - The function used to format the timestamp.\r\n     */\r\n    static setTimestampFormatter(formatter: (timestamp: Date) => string) {\r\n        loggingSettings.timestampFormatter = formatter;\r\n    }\r\n    /**\r\n     * Set the basic timestamp formatter for the logger in HH:mm:ss.SS format.\r\n     */\r\n    static setBasicTimestampFormatter() {\r\n        loggingSettings.timestampFormatter = (timestamp: Date) => {\r\n            const hours = timestamp.getHours().toString().padStart(2, '0');\r\n            const minutes = timestamp.getMinutes().toString().padStart(2, '0');\r\n            const seconds = timestamp.getSeconds().toString().padStart(2, '0');\r\n            const centiseconds = Math.floor(timestamp.getMilliseconds() / 10)\r\n                .toString()\r\n                .padStart(2, '0');\r\n            return `${hours}:${minutes}:${seconds}.${centiseconds}`;\r\n        };\r\n    }\r\n    /**\r\n     * Set the JSON formatter for the logger.\r\n     * @param {ColorJSON} formatter - The json formatter to set.\r\n     */\r\n    static setJsonFormatter(formatter: ColorJSON) {\r\n        loggingSettings.jsonFormatter = formatter;\r\n    }\r\n    /**\r\n     * Get the output configuration for the logger.\r\n     * @returns {OutputConfig} The output configuration.\r\n     */\r\n    static getOutputConfig(): OutputConfig {\r\n        return loggingSettings.outputConfig;\r\n    }\r\n    /**\r\n     * Returns a new Logger.\r\n     *\r\n     * @param {string} name - The name of the Logger.\r\n     * @param {string[]} tags - The tags for the Logger as strings.\r\n     *\r\n     * @returns {Logger} A new Logger.\r\n     */\r\n    static getLogger(name: string, ...tags: string[]): Logger {\r\n        LOGGING: {\r\n            if (!Logger.initialized) {\r\n                Logger.init();\r\n            }\r\n        }\r\n        return new Logger(name, tags);\r\n    }\r\n    /**\r\n     * Construct a new Logger\r\n     *\r\n     * @param {string} name - The name of the Logger.\r\n     * @param {string[]} tags - The tags for the logger as strings.\r\n     */\r\n    private constructor(\r\n        public name: string,\r\n        public tags: string[] = []\r\n    ) {}\r\n\r\n    /**\r\n     * Log messages with the level set.\r\n     *\r\n     * @param {LogLevel} level - The LogLevel to log the messages at.\r\n     * @param {array} message - An array of the messages to log.\r\n     */\r\n    private log(level: LogLevel, ...message: unknown[]) {\r\n        LOGGING: {\r\n            if (level.level < loggingSettings.level.level) return;\r\n            if (loggingSettings.filter.length === 0 || this.tags.length === 0) {\r\n                this.logRaw(level, ...message);\r\n                return;\r\n            }\r\n            for (const filter of loggingSettings.filter) {\r\n                if (filter.startsWith('!')) {\r\n                    if (\r\n                        starMatch(filter.substring(1), this.name) ||\r\n                        this.tags.some((tag) =>\r\n                            starMatch(filter.substring(1), tag)\r\n                        )\r\n                    ) {\r\n                        return;\r\n                    }\r\n                }\r\n                if (\r\n                    starMatch(filter, this.name) ||\r\n                    this.tags.some((tag) => starMatch(filter, tag))\r\n                ) {\r\n                    this.logRaw(level, ...message);\r\n                    return;\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    private stringifyError(x: Error): string {\r\n        let stack = x.stack ?? '';\r\n        if (sourceMapping) {\r\n            // This regex matches a parenthesized file location.\r\n            // It expects a file ending in \".js\", a colon, a line number, and optionally another colon with a column.\r\n            // Examples it matches:\r\n            //   (folder/fileName.js:123)\r\n            //   (folder/fileName.js:123:45)\r\n            const stackLineRegex = /\\(([^)]+\\.js):(\\d+)(?::(\\d+))?\\)/;\r\n\r\n            // Process each line of the error stack.\r\n            stack = stack\r\n                .split('\\n')\r\n                .map((line) => {\r\n                    const match = stackLineRegex.exec(line);\r\n                    if (match) {\r\n                        const filePath = match[1]; // e.g., folder/fileName.js\r\n                        const lineNumber =\r\n                            parseInt(match[2], 10) -\r\n                            sourceMapping.metadata.offset;\r\n                        if (\r\n                            filePath.includes(sourceMapping.metadata.filePath)\r\n                        ) {\r\n                            const mappingEntry =\r\n                                globalSourceMapping[lineNumber];\r\n                            if (mappingEntry) {\r\n                                // Build the replacement string using the mapped source and original line.\r\n                                // We ignore the column information as you don't care about it.\r\n                                const replacement = `(${mappingEntry.source}:${mappingEntry.originalLine})`;\r\n                                return line.replace(\r\n                                    stackLineRegex,\r\n                                    replacement\r\n                                );\r\n                            }\r\n                        }\r\n                    }\r\n                    return line;\r\n                })\r\n                .join('\\n');\r\n        }\r\n\r\n        return `${ChatColor.DARK_RED}${ChatColor.BOLD}${x.message}\\n${ChatColor.RESET}${ChatColor.GRAY}${ChatColor.ITALIC}${stack}${ChatColor.RESET}`;\r\n    }\r\n\r\n    /**\r\n     * Internal function to log messages with the level set, that bypasses the filters.\r\n     *\r\n     * @param {LogLevel} level - The LogLevel to log the messages at.\r\n     * @param {array} message - An array of the messages to log.\r\n     */\r\n    private logRaw(level: LogLevel, ...message: unknown[]) {\r\n        LOGGING: {\r\n            const msgs: string[] = message.map((x: unknown) => {\r\n                if (x === void 0) {\r\n                    return ChatColor.GOLD + 'undefined' + ChatColor.RESET;\r\n                }\r\n                if (x === null) {\r\n                    return ChatColor.GOLD + 'null' + ChatColor.RESET;\r\n                }\r\n                if (x && x instanceof Error) {\r\n                    return this.stringifyError(x);\r\n                }\r\n                if (typeof x === 'object' || Array.isArray(x)) {\r\n                    return (\r\n                        loggingSettings.jsonFormatter.stringify(x) +\r\n                        ChatColor.RESET\r\n                    );\r\n                }\r\n                return x.toString() + ChatColor.RESET;\r\n            });\r\n            const now = new Date();\r\n            const formattedTimestamp = loggingSettings.timestampFormatter(now);\r\n            const formatted = loggingSettings.formatFunction(\r\n                level,\r\n                this,\r\n                loggingSettings.messagesJoinFunction(msgs),\r\n                formattedTimestamp,\r\n                loggingSettings.outputTags ? this.tags : undefined\r\n            );\r\n            const outputs = loggingSettings.outputConfig[level.level] || [\r\n                OutputType.Chat,\r\n                OutputType.ConsoleInfo,\r\n            ];\r\n            if (outputs.includes(OutputType.Chat)) {\r\n                try {\r\n                    world.sendMessage(formatted);\r\n                } catch (_) {\r\n                    system.run(() => {\r\n                        world.sendMessage(formatted);\r\n                    });\r\n                }\r\n            }\r\n            if (outputs.includes(OutputType.ConsoleInfo)) {\r\n                if ((console as any).originalLog) {\r\n                    (console as any).originalLog(\r\n                        ChatColor.stripColor(formatted)\r\n                    );\r\n                } else {\r\n                    console.log(ChatColor.stripColor(formatted));\r\n                }\r\n            }\r\n            if (outputs.includes(OutputType.ConsoleWarn)) {\r\n                console.warn(formatted);\r\n            }\r\n            if (outputs.includes(OutputType.ConsoleError)) {\r\n                console.error(formatted);\r\n            }\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Logs a trace message.\r\n     *\r\n     * @param {...unknown} message - The message(s) to be logged.\r\n     */\r\n    trace(...message: unknown[]) {\r\n        LOGGING: this.log(LogLevel.Trace, ...message);\r\n    }\r\n\r\n    /**\r\n     * Logs debug message.\r\n     *\r\n     * @param {...unknown[]} message - The message(s) to be logged.\r\n     */\r\n    debug(...message: unknown[]) {\r\n        LOGGING: this.log(LogLevel.Debug, ...message);\r\n    }\r\n\r\n    /**\r\n     * Logs an informational message.\r\n     *\r\n     * @param {...unknown[]} message - The message(s) to be logged.\r\n     */\r\n    info(...message: unknown[]) {\r\n        LOGGING: this.log(LogLevel.Info, ...message);\r\n    }\r\n\r\n    /**\r\n     * Logs a warning message.\r\n     *\r\n     * @param {...unknown[]} message - The warning message or messages to be logged.\r\n     */\r\n    warn(...message: unknown[]) {\r\n        LOGGING: this.log(LogLevel.Warn, ...message);\r\n    }\r\n\r\n    /**\r\n     * Logs an error message.\r\n     *\r\n     * @param {...unknown[]} message - The error message(s) to log.\r\n     */\r\n    error(...message: unknown[]) {\r\n        LOGGING: this.log(LogLevel.Error, ...message);\r\n    }\r\n\r\n    /**\r\n     * Logs a fatal error.\r\n     *\r\n     * @param {unknown[]} message - The error message to log.\r\n     */\r\n    fatal(...message: unknown[]) {\r\n        LOGGING: this.log(LogLevel.Fatal, ...message);\r\n    }\r\n}\r\n","/**\n * ChatColor is a class for defining color codes.\n */\nexport default class ChatColor {\n    /**\n     * Black color code. (0)\n     */\n    public static readonly BLACK: ChatColor = new ChatColor('0', 0x000000);\n    /**\n     * Dark blue color code. (1)\n     */\n    public static readonly DARK_BLUE: ChatColor = new ChatColor('1', 0x0000aa);\n    /**\n     * Dark green color code. (2)\n     */\n    public static readonly DARK_GREEN: ChatColor = new ChatColor('2', 0x00aa00);\n    /**\n     * Dark aqua color code. (3)\n     */\n    public static readonly DARK_AQUA: ChatColor = new ChatColor('3', 0x00aaaa);\n    /**\n     * Dark red color code. (4)\n     */\n    public static readonly DARK_RED: ChatColor = new ChatColor('4', 0xaa0000);\n    /**\n     * Dark purple color code. (5)\n     */\n    public static readonly DARK_PURPLE: ChatColor = new ChatColor(\n        '5',\n        0xaa00aa\n    );\n    /**\n     * Gold color code. (6)\n     */\n    public static readonly GOLD: ChatColor = new ChatColor('6', 0xffaa00);\n    /**\n     * Gray color code. (7)\n     */\n    public static readonly GRAY: ChatColor = new ChatColor('7', 0xaaaaaa);\n    /**\n     * Dark gray color code. (8)\n     */\n    public static readonly DARK_GRAY: ChatColor = new ChatColor('8', 0x555555);\n    /**\n     * Blue color code. (9)\n     */\n    public static readonly BLUE: ChatColor = new ChatColor('9', 0x5555ff);\n    /**\n     * Green color code. (a)\n     */\n    public static readonly GREEN: ChatColor = new ChatColor('a', 0x55ff55);\n    /**\n     * Aqua color code. (b)\n     */\n    public static readonly AQUA: ChatColor = new ChatColor('b', 0x55ffff);\n    /**\n     * Red color code. (c)\n     */\n    public static readonly RED: ChatColor = new ChatColor('c', 0xff5555);\n    /**\n     * Light purple color code. (d)\n     */\n    public static readonly LIGHT_PURPLE: ChatColor = new ChatColor(\n        'd',\n        0xff55ff\n    );\n    /**\n     * Yellow color code. (e)\n     */\n    public static readonly YELLOW: ChatColor = new ChatColor('e', 0xffff55);\n    /**\n     * White color code. (f)\n     */\n    public static readonly WHITE: ChatColor = new ChatColor('f', 0xffffff);\n    /**\n     * MineCoin gold color code. (g)\n     */\n    public static readonly MINECOIN_GOLD: ChatColor = new ChatColor(\n        'g',\n        0xded605\n    );\n    /**\n     * Material quartz color code. (h)\n     */\n    public static readonly MATERIAL_QUARTZ: ChatColor = new ChatColor(\n        'h',\n        0xe3d4d1\n    );\n    /**\n     * Material iron color code. (i)\n     */\n    public static readonly MATERIAL_IRON: ChatColor = new ChatColor(\n        'i',\n        0xcecaca\n    );\n    /**\n     * Material netherite color code. (j)\n     */\n    public static readonly MATERIAL_NETHERITE: ChatColor = new ChatColor(\n        'j',\n        0x443a3b\n    );\n    /**\n     * Material redstone color code. (m)\n     */\n    public static readonly MATERIAL_REDSTONE: ChatColor = new ChatColor(\n        'm',\n        0x971607\n    );\n    /**\n     * Material copper color code. (n)\n     */\n    public static readonly MATERIAL_COPPER: ChatColor = new ChatColor(\n        'n',\n        0xb4684d\n    );\n    /**\n     * Material gold color code. (p)\n     */\n    public static readonly MATERIAL_GOLD: ChatColor = new ChatColor(\n        'p',\n        0xdeb12d\n    );\n    /**\n     * Material emerald color code. (q)\n     */\n    public static readonly MATERIAL_EMERALD: ChatColor = new ChatColor(\n        'q',\n        0x11a036\n    );\n    /**\n     * Material diamond color code. (s)\n     */\n    public static readonly MATERIAL_DIAMOND: ChatColor = new ChatColor(\n        's',\n        0x2cbaa8\n    );\n    /**\n     * Material lapis color code. (t)\n     */\n    public static readonly MATERIAL_LAPIS: ChatColor = new ChatColor(\n        't',\n        0x21497b\n    );\n    /**\n     * Material amethyst color code. (u)\n     */\n    public static readonly MATERIAL_AMETHYST: ChatColor = new ChatColor(\n        'u',\n        0x9a5cc6\n    );\n    /**\n     * Obfuscated color code. (k)\n     */\n    public static readonly OBFUSCATED: ChatColor = new ChatColor('k');\n    /**\n     * Bold color code. (l)\n     */\n    public static readonly BOLD: ChatColor = new ChatColor('l');\n    /**\n     * Italic color code. (o)\n     */\n    public static readonly ITALIC: ChatColor = new ChatColor('o');\n    /**\n     * Reset color code. (r)\n     */\n    public static readonly RESET: ChatColor = new ChatColor('r');\n\n    /**\n     * All available color codes.\n     */\n    public static readonly VALUES: ChatColor[] = [\n        ChatColor.BLACK,\n        ChatColor.DARK_BLUE,\n        ChatColor.DARK_GREEN,\n        ChatColor.DARK_AQUA,\n        ChatColor.DARK_RED,\n        ChatColor.DARK_PURPLE,\n        ChatColor.GOLD,\n        ChatColor.GRAY,\n        ChatColor.DARK_GRAY,\n        ChatColor.BLUE,\n        ChatColor.GREEN,\n        ChatColor.AQUA,\n        ChatColor.RED,\n        ChatColor.LIGHT_PURPLE,\n        ChatColor.YELLOW,\n        ChatColor.WHITE,\n        ChatColor.MINECOIN_GOLD,\n        ChatColor.MATERIAL_QUARTZ,\n        ChatColor.MATERIAL_IRON,\n        ChatColor.MATERIAL_NETHERITE,\n        ChatColor.MATERIAL_REDSTONE,\n        ChatColor.MATERIAL_COPPER,\n        ChatColor.MATERIAL_GOLD,\n        ChatColor.MATERIAL_EMERALD,\n        ChatColor.MATERIAL_DIAMOND,\n        ChatColor.MATERIAL_LAPIS,\n        ChatColor.MATERIAL_AMETHYST,\n        ChatColor.OBFUSCATED,\n        ChatColor.BOLD,\n        ChatColor.ITALIC,\n        ChatColor.RESET,\n    ];\n\n    /**\n     * All available color codes excluding the formatting codes.\n     */\n    public static readonly ALL_COLORS: ChatColor[] = [\n        ChatColor.BLACK,\n        ChatColor.DARK_BLUE,\n        ChatColor.DARK_GREEN,\n        ChatColor.DARK_AQUA,\n        ChatColor.DARK_RED,\n        ChatColor.DARK_PURPLE,\n        ChatColor.GOLD,\n        ChatColor.GRAY,\n        ChatColor.DARK_GRAY,\n        ChatColor.BLUE,\n        ChatColor.GREEN,\n        ChatColor.AQUA,\n        ChatColor.RED,\n        ChatColor.LIGHT_PURPLE,\n        ChatColor.YELLOW,\n        ChatColor.WHITE,\n        ChatColor.MINECOIN_GOLD,\n        ChatColor.MATERIAL_QUARTZ,\n        ChatColor.MATERIAL_IRON,\n        ChatColor.MATERIAL_NETHERITE,\n        ChatColor.MATERIAL_REDSTONE,\n        ChatColor.MATERIAL_COPPER,\n        ChatColor.MATERIAL_GOLD,\n        ChatColor.MATERIAL_EMERALD,\n        ChatColor.MATERIAL_DIAMOND,\n        ChatColor.MATERIAL_LAPIS,\n        ChatColor.MATERIAL_AMETHYST,\n    ];\n\n    private r?: number;\n    private g?: number;\n    private b?: number;\n\n    /**\n     * Class ChatColor Constructor.\n     * @param code - The color code as a string.\n     * @param color - The color code as a hexadecimal number. Can be undefined.\n     */\n    constructor(\n        private code: string,\n        private color?: number\n    ) {\n        if (color) {\n            this.r = (color >> 16) & 0xff;\n            this.g = (color >> 8) & 0xff;\n            this.b = color & 0xff;\n        }\n    }\n\n    /**\n     * PREFIX is the section sign (§) used in Minecraft color codes.\n     */\n    private static readonly PREFIX = '§';\n\n    /**\n     * Returns the string representation of the ChatColor instance,\n     * which includes the PREFIX followed by the color code.\n     * @returns A string representing the ChatColor instance\n     */\n    public toString() {\n        return ChatColor.PREFIX + this.code;\n    }\n\n    /**\n     * Returns the color code of the ChatColor instance.\n     * @returns The color code of this ChatColor instance.\n     */\n    public toRGB(): number | undefined {\n        return this.color;\n    }\n\n    /**\n     * Returns the hexadecimal string representation of the color code\n     * @returns {string | undefined} The hexadecimal representation of the color.\n     */\n    public toHex(): string | undefined {\n        return this.color?.toString(16);\n    }\n\n    /**\n     * Retrieve the value of the red component.\n     *\n     * @returns {number | undefined} The value of the red component, or undefined if it is not set.\n     */\n    public getRed(): number | undefined {\n        return this.r;\n    }\n\n    /**\n     * Retrieves the green value of the current color.\n     *\n     * @returns {number | undefined} The green value of the color, or undefined if it is not set.\n     */\n    public getGreen(): number | undefined {\n        return this.g;\n    }\n\n    /**\n     * Retrieves the blue value of a color.\n     *\n     * @returns The blue value of the color.\n     * @type {number | undefined}\n     */\n    public getBlue(): number | undefined {\n        return this.b;\n    }\n\n    /**\n     * Retrieves the format code associated with the chat color.\n     *\n     * @returns {string} The format code of the chat color.\n     */\n    public getCode(): string {\n        return this.code;\n    }\n\n    /**\n     * Removes color codes from the specified string\n     * @param str - The string from which color codes will be removed.\n     * @returns The string cleared from color codes.\n     */\n    static stripColor(str: string) {\n        return str.replace(/§[0-9a-u]/g, '');\n    }\n\n    /**\n     * Finds the closest ChatColor code for the given RGB values\n     * @param r - Red part of the color.\n     * @param g - Green part of the color.\n     * @param b - Blue part of the color.\n     * @returns The closest ChatColor for the given RGB values.\n     */\n    static findClosestColor(r: number, g: number, b: number): ChatColor {\n        let minDistance = Number.MAX_VALUE;\n        let closestColor: ChatColor = ChatColor.WHITE;\n        for (const color of ChatColor.ALL_COLORS) {\n            if (color.r && color.g && color.b) {\n                const distance = Math.sqrt(\n                    Math.pow(color.r - r, 2) +\n                        Math.pow(color.g - g, 2) +\n                        Math.pow(color.b - b, 2)\n                );\n                if (distance < minDistance) {\n                    minDistance = distance;\n                    closestColor = color;\n                }\n            }\n        }\n        return closestColor;\n    }\n}\n","import ChatColor from './ChatColor';\n\ninterface Context {\n    indentLevel: number;\n    visited: WeakSet<any>;\n}\n\nexport default class ColorJSON {\n    // Tokens\n    public OpenObject: string = '{';\n    public CloseObject: string = '}';\n    public OpenArray: string = '[';\n    public CloseArray: string = ']';\n    public Comma: string = ',';\n    public KeyValueSeparator: string = ':';\n    public StringDelimiter: string = '\"';\n    public KeyDelimiter: string = '';\n    public Indent: string = '  ';\n    public NewLine: string = '\\n';\n    public Space: string = ' ';\n\n    // Threshold for inline representation\n    public InlineThreshold: number = 60;\n    // Maximum depth to which objects will be traversed\n    public MaxDepth: number = 1;\n    // Whether to include class names\n    public IncludeClassNames: boolean = true;\n\n    // Values\n    public FunctionValue: string = 'ƒ';\n    public NullValue: string = 'null';\n    public UndefinedValue: string = 'undefined';\n    public TrueValue: string = 'true';\n    public FalseValue: string = 'false';\n    public CycleValue: string = '[...cycle...]';\n    public TruncatedObjectValue: string = '{...}';\n\n    // Colors\n    public OpenCloseObjectColor: ChatColor | string = ChatColor.YELLOW;\n    public OpenCloseArrayColor: ChatColor | string = ChatColor.AQUA;\n    public NumberColor: ChatColor | string = ChatColor.DARK_AQUA;\n    public StringColor: ChatColor | string = ChatColor.DARK_GREEN;\n    public BooleanColor: ChatColor | string = ChatColor.GOLD;\n    public NullColor: ChatColor | string = ChatColor.GOLD;\n    public KeyColor: ChatColor | string = ChatColor.GRAY;\n    public EscapeColor: ChatColor | string = ChatColor.GOLD;\n    public FunctionColor: ChatColor | string = ChatColor.GRAY;\n    public ClassColor: ChatColor | string = ChatColor.GRAY;\n    public ClassStyle: ChatColor | string = ChatColor.BOLD;\n    public CycleColor: ChatColor | string = ChatColor.DARK_RED;\n\n    /**\n     * The default ColorJSON instance\n     */\n    public static readonly DEFAULT: ColorJSON = new ColorJSON();\n\n    private static createPlain(): ColorJSON {\n        const plain = new ColorJSON();\n        plain.OpenCloseObjectColor = '';\n        plain.OpenCloseArrayColor = '';\n        plain.NumberColor = '';\n        plain.StringColor = '';\n        plain.BooleanColor = '';\n        plain.NullColor = '';\n        plain.KeyColor = '';\n        plain.EscapeColor = '';\n        plain.FunctionColor = '';\n        plain.ClassColor = '';\n        plain.ClassStyle = '';\n        plain.CycleColor = '';\n        return plain;\n    }\n\n    /**\n     * A ColorJSON instance that does not colorize anything.\n     */\n    public static readonly PLAIN: ColorJSON = this.createPlain();\n\n    /**\n     * Transforms a value into a chat-friendly, colored JSON representation.\n     * @param value - The value to transform.\n     */\n    public stringify(value: unknown): string {\n        return this.stringifyValue(value, {\n            indentLevel: 0,\n            visited: new WeakSet<any>(),\n        });\n    }\n\n    /**\n     * Transforms a string into a JSON representation.\n     * @param value - The string to transform.\n     */\n    protected stringifyString(value: string): string {\n        // Escaping and concatenating with color, and delimiter\n        return (\n            this.StringColor +\n            this.StringDelimiter +\n            this.escapeString(value) +\n            this.StringDelimiter +\n            ChatColor.RESET\n        );\n    }\n\n    /**\n     * Transforms a number into a JSON representation.\n     * @param value - The number to transform.\n     */\n    protected stringifyNumber(value: number): string {\n        // Converting to string and concatenating with colors\n        return this.NumberColor + value.toString() + ChatColor.RESET;\n    }\n\n    /**\n     * Transforms a boolean into a JSON representation.\n     * @param value - The boolean to transform.\n     */\n    protected stringifyBoolean(value: boolean): string {\n        // Boolean to string transformation along with colors\n        return (\n            this.BooleanColor +\n            (value ? this.TrueValue : this.FalseValue) +\n            ChatColor.RESET\n        );\n    }\n\n    /**\n     * Transforms a function into a JSON representation.\n     * @param value - The function to transform.\n     */\n    // eslint-disable-next-line @typescript-eslint/ban-types\n    protected stringifyFunction(value: Function): string {\n        // Functions are transformed to predefined function token\n        return this.FunctionColor + this.FunctionValue + ChatColor.RESET;\n    }\n\n    /**\n     * Returns a null JSON representation.\n     */\n    protected stringifyNull(): string {\n        // Null transformation\n        return this.NullColor + this.NullValue + ChatColor.RESET;\n    }\n\n    /**\n     * Returns an undefined JSON representation.\n     */\n    protected stringifyUndefined(): string {\n        // Undefined transformation\n        return this.NullColor + this.UndefinedValue + ChatColor.RESET;\n    }\n\n    /**\n     * Returns a cycle JSON representation.\n     */\n    protected stringifyCycle(): string {\n        return this.CycleColor + this.CycleValue + ChatColor.RESET;\n    }\n\n    /**\n     * Transforms an array into a JSON representation.\n     * @param value - The array to transform.\n     * @param indentLevel - The indentation level for pretty-printing.\n     */\n    protected stringifyArray(value: unknown[], ctx: Context): string {\n        const indentSpace = this.Indent.repeat(ctx.indentLevel);\n        // If array is empty, just returns colored `[]`\n        if (value.length === 0) {\n            return (\n                this.OpenCloseArrayColor +\n                this.OpenArray +\n                this.CloseArray +\n                ChatColor.RESET\n            );\n        }\n        let result =\n            this.OpenCloseArrayColor +\n            this.OpenArray +\n            ChatColor.RESET +\n            this.NewLine;\n        let compactResult =\n            this.OpenCloseArrayColor + this.OpenArray + ChatColor.RESET;\n        value.forEach((item, index) => {\n            result +=\n                indentSpace +\n                this.Indent +\n                this.stringifyValue(item, this.indent(ctx));\n            result +=\n                index < value.length - 1\n                    ? this.Comma + this.NewLine\n                    : this.NewLine;\n\n            compactResult += this.stringifyValue(item, this.indent(ctx));\n            compactResult +=\n                index < value.length - 1 ? this.Comma + this.Space : '';\n        });\n        result +=\n            indentSpace +\n            this.OpenCloseArrayColor +\n            this.CloseArray +\n            ChatColor.RESET;\n        compactResult +=\n            this.OpenCloseArrayColor + this.CloseArray + ChatColor.RESET;\n\n        // If the compact representation is small enough, use it\n        if (compactResult.length < this.InlineThreshold) {\n            return compactResult;\n        }\n        return result;\n    }\n\n    /**\n     * Transforms an object into a truncated JSON representation.\n     * @param value - The object to transform.\n     * @param className - Class Name of the object.\n     * @param indentLevel - The indentation level for pretty-printing.\n     */\n    protected stringifyTruncatedObject(\n        value: object,\n        className: string,\n        ctx: Context\n    ): string {\n        return (\n            (this.IncludeClassNames\n                ? this.ClassColor +\n                  '' +\n                  this.ClassStyle +\n                  className +\n                  ChatColor.RESET +\n                  this.Space\n                : '') + this.TruncatedObjectValue\n        );\n    }\n\n    /**\n     * Transforms an object into a JSON representation.\n     * @param value - The object to transform.\n     * @param className - Class Name of the object.\n     * @param entries - Entries of the object to transform.\n     * @param indentLevel - The indentation level for pretty-printing.\n     */\n    protected stringifyObject(\n        value: object,\n        className: string,\n        entries: any[][],\n        ctx: Context\n    ): string {\n        const indentSpace = this.Indent.repeat(ctx.indentLevel);\n        const prefix =\n            this.IncludeClassNames && className !== 'Object'\n                ? this.ClassColor +\n                  '' +\n                  this.ClassStyle +\n                  className +\n                  ChatColor.RESET +\n                  this.Space\n                : '';\n        // If object has no entries, just return `{}` possibly preceded by class name\n        if (entries.length === 0) {\n            return (\n                prefix +\n                this.OpenCloseObjectColor +\n                this.OpenObject +\n                this.CloseObject +\n                ChatColor.RESET\n            );\n        }\n        // Create both a compact and a multi-line representation\n        let result =\n            prefix +\n            this.OpenCloseObjectColor +\n            this.OpenObject +\n            ChatColor.RESET +\n            this.NewLine;\n        let compactResult =\n            prefix +\n            this.OpenCloseObjectColor +\n            this.OpenObject +\n            ChatColor.RESET;\n\n        // Stringify each entry\n        entries.forEach(([key, val], index) => {\n            const compactVal = this.stringifyValue(val, this.indent(ctx));\n            result +=\n                indentSpace +\n                this.Indent +\n                this.KeyColor +\n                this.KeyDelimiter +\n                key +\n                this.KeyDelimiter +\n                ChatColor.RESET +\n                this.KeyValueSeparator +\n                this.Space +\n                compactVal;\n            result +=\n                index < entries.length - 1\n                    ? this.Comma + this.NewLine\n                    : this.NewLine;\n\n            compactResult +=\n                this.KeyColor +\n                key +\n                ChatColor.RESET +\n                this.KeyValueSeparator +\n                this.Space +\n                compactVal;\n            compactResult +=\n                index < entries.length - 1 ? this.Comma + this.Space : '';\n        });\n        // Close the object\n        result +=\n            indentSpace +\n            this.OpenCloseObjectColor +\n            this.CloseObject +\n            ChatColor.RESET;\n        compactResult +=\n            this.OpenCloseObjectColor + this.CloseObject + ChatColor.RESET;\n\n        // If the compact representation is small enough, use it\n        if (compactResult.length < this.InlineThreshold) {\n            return compactResult;\n        }\n        return result;\n    }\n\n    protected shouldTruncateObject(\n        value: object,\n        className: string,\n        ctx: Context\n    ): boolean {\n        return !(\n            className === 'Object' ||\n            ctx.indentLevel <= this.MaxDepth ||\n            this.MaxDepth <= 0\n        );\n    }\n\n    /**\n     * Transforms a value of any type into a JSON representation. This function is not meant to be overridden.\n     * @param value - The value to transform.\n     * @param indentLevel - The indentation level for pretty-printing.\n     */\n    protected stringifyValue(value: unknown, ctx: Context): string {\n        // Stringify primitives like null, undefined, number, string, boolean\n        if (value === null) return this.stringifyNull();\n        if (value === void 0) return this.stringifyUndefined();\n        if (typeof value === 'number') return this.stringifyNumber(value);\n        if (typeof value === 'string') return this.stringifyString(value);\n        if (typeof value === 'boolean') return this.stringifyBoolean(value);\n        if (typeof value === 'function') return this.stringifyFunction(value);\n\n        // Check for cycles\n        if (this.isCycle(value, ctx)) {\n            return this.stringifyCycle();\n        }\n        this.markCycle(value, ctx);\n\n        // Stringify arrays\n        if (Array.isArray(value)) {\n            const result = this.stringifyArray(\n                value,\n                ctx.indentLevel ? this.indent(ctx) : ctx\n            );\n            this.clearCycle(value, ctx);\n            return result;\n        }\n\n        // Stringify objects\n        if (typeof value === 'object') {\n            // Get class name\n            const name = value.constructor.name;\n            // If it's a plain object, or we haven't reached the max depth, stringify it\n            if (!this.shouldTruncateObject(value, name, ctx)) {\n                // Get all keys\n                const keySet: Set<string> = new Set();\n                // Get all keys from the prototype chain\n                let prototype = Object.getPrototypeOf(value);\n                let keys = Object.keys(prototype);\n                while (keys.length > 0) {\n                    keys.forEach((key) => keySet.add(key));\n                    prototype = Object.getPrototypeOf(prototype);\n                    keys = Object.keys(prototype);\n                }\n                // Get all keys from the object itself\n                Object.keys(value).forEach((key) => keySet.add(key));\n                keySet.delete('__cycleDetection__');\n                // Sort the keys\n                const allKeys = [...keySet].sort();\n                // Get all entries\n                const entries = allKeys\n                    .map((key: string) => {\n                        try {\n                            return [key, (value as any)[key] ?? void 0];\n                        } catch (e) {\n                            return [key, void 0];\n                        }\n                    })\n                    .filter(\n                        ([, val]) => typeof val !== 'function' && val !== void 0\n                    );\n                const result = this.stringifyObject(value, name, entries, ctx);\n                this.clearCycle(value, ctx);\n                return result;\n            } else {\n                const result = this.stringifyTruncatedObject(value, name, ctx);\n                this.clearCycle(value, ctx);\n                return result;\n            }\n        }\n        this.clearCycle(value, ctx);\n\n        // Stringify unknowns\n        return ChatColor.RESET + value.toString();\n    }\n\n    /**\n     * Escapes a string for JSON.\n     * @param str - The string to escape.\n     */\n    protected escapeString(str: string): string {\n        return str\n            .replace(/\\\\/g, this.EscapeColor + '\\\\\\\\' + this.StringColor)\n            .replace(/\"/g, this.EscapeColor + '\\\\\"' + this.StringColor)\n            .replace(/\\n/g, this.EscapeColor + '\\\\n' + this.StringColor)\n            .replace(/\\r/g, this.EscapeColor + '\\\\r' + this.StringColor)\n            .replace(/\\t/g, this.EscapeColor + '\\\\t' + this.StringColor);\n    }\n\n    private markCycle(value: any, ctx: Context) {\n        ctx.visited.add(value);\n    }\n\n    private isCycle(value: any, ctx: Context) {\n        return ctx.visited.has(value);\n    }\n\n    private clearCycle(value: any, ctx: Context) {\n        ctx.visited.delete(value);\n    }\n\n    private indent(ctx: Context): Context {\n        return { ...ctx, indentLevel: ctx.indentLevel + 1 };\n    }\n}\n","import { Vector2, Direction, VectorXZ } from '@minecraft/server';\r\nimport { Logger } from '../Logging';\r\nimport Vec3 from './Vec3';\r\nimport MutVec2 from './MutVec2';\r\n\r\ntype VectorLike =\r\n    | VectorXZ\r\n    | Vector2\r\n    | Vec2\r\n    | MutVec2\r\n    | Vec3\r\n    | Direction\r\n    | number[]\r\n    | number;\r\n\r\nexport default class Vec2 implements Vector2 {\r\n    private static readonly log = Logger.getLogger(\r\n        'vec2',\r\n        'vec2',\r\n        'bedrock-boost'\r\n    );\r\n    public static readonly Zero = new Vec2(0, 0);\r\n    public static readonly North = new Vec2(Direction.North);\r\n    public static readonly South = new Vec2(Direction.South);\r\n    public static readonly East = new Vec2(Direction.East);\r\n    public static readonly West = new Vec2(Direction.West);\r\n\r\n    readonly x: number;\r\n    readonly y: number;\r\n    constructor(x: number, y: number);\r\n    constructor(x: Vec2);\r\n    constructor(x: Vec3);\r\n    constructor(x: Vector2);\r\n    constructor(x: Direction);\r\n    constructor(x: number[]);\r\n    constructor(x: VectorLike, y?: number) {\r\n        if (x === Direction.Down || x === Direction.Up) {\r\n            Vec2.log.error(new Error('Invalid direction'), x);\r\n            throw new Error('Invalid direction');\r\n        } else if (x === Direction.North) {\r\n            this.x = 0;\r\n            this.y = 1;\r\n        } else if (x === Direction.South) {\r\n            this.x = 0;\r\n            this.y = -1;\r\n        } else if (x === Direction.East) {\r\n            this.x = 1;\r\n            this.y = 0;\r\n        } else if (x === Direction.West) {\r\n            this.x = -1;\r\n            this.y = 0;\r\n        } else if (typeof x === 'number') {\r\n            this.x = x;\r\n            this.y = y!;\r\n        } else if (Array.isArray(x)) {\r\n            this.x = x[0];\r\n            this.y = x[1];\r\n        } else if (x instanceof Vec2) {\r\n            this.x = x.x;\r\n            this.y = x.y;\r\n        } else if (x instanceof MutVec2) {\r\n            this.x = x.x;\r\n            this.y = x.y;\r\n        } else if (x instanceof Vec3) {\r\n            this.x = x.x;\r\n            this.y = x.y;\r\n        } else {\r\n            const anyX = x as any;\r\n            if (\r\n                !anyX ||\r\n                (!anyX.x && anyX.x !== 0) ||\r\n                (!anyX.y && anyX.y !== 0 && !anyX.z && anyX.z !== 0)\r\n            ) {\r\n                Vec2.log.error(new Error('Invalid vector'), x);\r\n                throw new Error('Invalid vector');\r\n            }\r\n            this.x = x.x;\r\n            if (anyX.y || anyX.y === 0) {\r\n                this.y = anyX.y;\r\n            } else if (anyX.z || anyX.z === 0) {\r\n                this.y = anyX.z;\r\n            } else {\r\n                Vec2.log.error(new Error('Invalid vector'), x);\r\n                throw new Error('Invalid vector');\r\n            }\r\n        }\r\n    }\r\n    /**\r\n     * Creates a new vector from the given values.\r\n     */\r\n    static from(x: number, y: number): Vec2;\r\n    static from(x: Vec2): Vec2;\r\n    static from(x: Vector2): Vec2;\r\n    static from(x: VectorXZ): Vec2;\r\n    static from(x: Direction): Vec2;\r\n    static from(x: number[]): Vec2;\r\n    static from(x: VectorLike, y?: number): Vec2 {\r\n        if (x instanceof Vec2) return x;\r\n        if (x instanceof MutVec2) return new Vec2(x.x, x.y);\r\n        if (typeof x === 'number' && y !== undefined) {\r\n            return new Vec2(x, y);\r\n        }\r\n        if (Array.isArray(x)) {\r\n            return new Vec2(x);\r\n        }\r\n        if (x === Direction.Down || x === Direction.Up) {\r\n            Vec2.log.error(new Error('Invalid direction'), x);\r\n            throw new Error('Invalid direction');\r\n        }\r\n        if (x === Direction.North) return Vec2.North;\r\n        if (x === Direction.South) return Vec2.South;\r\n        if (x === Direction.East) return Vec2.East;\r\n        if (x === Direction.West) return Vec2.West;\r\n        return new Vec2(x as any, y as any);\r\n    }\r\n    private static _from(x: VectorLike, y?: number): Vec2 {\r\n        if (typeof x === 'number' && y === undefined) {\r\n            return new Vec2(x, x);\r\n        }\r\n        if (x instanceof Vec2) return x;\r\n        if (x instanceof MutVec2) return new Vec2(x.x, x.y);\r\n        if (typeof x === 'number' && y !== undefined) {\r\n            return new Vec2(x, y);\r\n        }\r\n        if (Array.isArray(x)) {\r\n            return new Vec2(x);\r\n        }\r\n        if (x === Direction.Down || x === Direction.Up) {\r\n            Vec2.log.error(new Error('Invalid direction'), x);\r\n            throw new Error('Invalid direction');\r\n        }\r\n        if (x === Direction.North) return Vec2.North;\r\n        if (x === Direction.South) return Vec2.South;\r\n        if (x === Direction.East) return Vec2.East;\r\n        if (x === Direction.West) return Vec2.West;\r\n        return new Vec2(x as any, y as any);\r\n    }\r\n    /**\r\n     * Creates a copy of the current vector.\r\n     *\r\n     * @returns A new vector with the same values as the current vector.\r\n     */\r\n    copy(): Vec2 {\r\n        return new Vec2(this.x, this.y);\r\n    }\r\n    /**\r\n     * Creates a mutable copy of the current vector.\r\n     *\r\n     * @returns A mutable vector with the same values as the current vector.\r\n     */\r\n    toMutable(): MutVec2 {\r\n        return new MutVec2(this.x, this.y);\r\n    }\r\n    /**\r\n     * Creates a new direction vector from yaw rotation.\r\n     *\r\n     * @param yaw - The yaw value in degrees.\r\n     * @returns A new vector representing the direction.\r\n     */\r\n    static fromYaw(yaw: number): Vec2 {\r\n        // Convert degrees to radians\r\n        const psi = yaw * (Math.PI / 180);\r\n\r\n        const x = Math.sin(psi);\r\n        const z = Math.cos(psi);\r\n        return new Vec2(x, z);\r\n    }\r\n\r\n    /**\r\n     * Converts the normal vector to yaw and pitch values.\r\n     *\r\n     * @returns A Vector2 containing the yaw and pitch values.\r\n     */\r\n    toYaw(): number {\r\n        if (this.isZero()) {\r\n            Vec2.log.error(\r\n                new Error('Cannot convert zero-length vector to direction')\r\n            );\r\n            throw new Error('Cannot convert zero-length vector to direction');\r\n        }\r\n        const direction = this.normalize();\r\n        const yaw = Math.atan2(direction.x, direction.y) * (180 / Math.PI);\r\n        return yaw;\r\n    }\r\n    /**\r\n     * Adds another vector to the current vector.\r\n     *\r\n     * @param v - The vector to be added.\r\n     * @returns The updated vector after addition.\r\n     */\r\n    add(x: number, y: number): Vec2;\r\n    add(x: Vec2): Vec2;\r\n    add(x: Vector2): Vec2;\r\n    add(x: VectorXZ): Vec2;\r\n    add(x: Direction): Vec2;\r\n    add(x: number[]): Vec2;\r\n    add(x: number): Vec2;\r\n    add(x: VectorLike, y?: number): Vec2 {\r\n        const v: Vec2 = Vec2._from(x, y);\r\n        return Vec2.from(v.x + this.x, v.y + this.y);\r\n    }\r\n\r\n    /**\r\n     * Returns the normalized vector pointing from this vector to the input.\r\n     *\r\n     * @param v - The vector to point towards.\r\n     * @returns The direction to the passed in Vector. Equivalent to (B-A).normalized()\r\n     */\r\n    directionTo(x: number, y: number): Vec2;\r\n    directionTo(x: Vec2): Vec2;\r\n    directionTo(x: Vector2): Vec2;\r\n    directionTo(x: VectorXZ): Vec2;\r\n    directionTo(x: Direction): Vec2;\r\n    directionTo(x: number[]): Vec2;\r\n    directionTo(x: VectorLike, y?: number): Vec2 {\r\n        const v: Vec2 = Vec2._from(x, y);\r\n        return v.subtract(this).normalize();\r\n    }\r\n\r\n    /**\r\n     * Subtracts another vector from the current vector.\r\n     *\r\n     * @param v - The vector to be subtracted.\r\n     * @returns The updated vector after subtraction.\r\n     */\r\n    subtract(x: number, y: number): Vec2;\r\n    subtract(x: Vec2): Vec2;\r\n    subtract(x: Vector2): Vec2;\r\n    subtract(x: VectorXZ): Vec2;\r\n    subtract(x: Direction): Vec2;\r\n    subtract(x: number[]): Vec2;\r\n    subtract(x: number): Vec2;\r\n    subtract(x: VectorLike, y?: number): Vec2 {\r\n        const v: Vec2 = Vec2._from(x, y);\r\n        return Vec2.from(this.x - v.x, this.y - v.y);\r\n    }\r\n    /**\r\n     * Multiplies the current vector by another vector or scalar.\r\n     *\r\n     * @param v - The vector or scalar to multiply with.\r\n     * @returns The updated vector after multiplication.\r\n     */\r\n    multiply(x: number, y: number): Vec2;\r\n    multiply(x: Vec2): Vec2;\r\n    multiply(x: Vector2): Vec2;\r\n    multiply(x: VectorXZ): Vec2;\r\n    multiply(x: Direction): Vec2;\r\n    multiply(x: number[]): Vec2;\r\n    multiply(x: number): Vec2;\r\n    multiply(x: VectorLike, y?: number): Vec2 {\r\n        const v: Vec2 = Vec2._from(x, y);\r\n        return Vec2.from(v.x * this.x, v.y * this.y);\r\n    }\r\n    /**\r\n     * Scales the current vector by a scalar.\r\n     *\r\n     * @param v - The scalar to scale by.\r\n     * @returns The updated vector after scaling.\r\n     */\r\n    scale(scalar: number): Vec2 {\r\n        return Vec2.from(this.x * scalar, this.y * scalar);\r\n    }\r\n    /**\r\n     * Divides the current vector by another vector or scalar.\r\n     *\r\n     * @param v - The vector or scalar to divide by.\r\n     * @returns The updated vector after division.\r\n     */\r\n    divide(x: number, y: number): Vec2;\r\n    divide(x: Vec2): Vec2;\r\n    divide(x: Vector2): Vec2;\r\n    divide(x: VectorXZ): Vec2;\r\n    divide(x: Direction): Vec2;\r\n    divide(x: number[]): Vec2;\r\n    divide(x: number): Vec2;\r\n    divide(x: VectorLike, y?: number): Vec2 {\r\n        const v: Vec2 = Vec2._from(x, y);\r\n        if (v.x === 0 || v.y === 0) throw new Error('Cannot divide by zero');\r\n        return Vec2.from(this.x / v.x, this.y / v.y);\r\n    }\r\n    /**\r\n     * Normalizes the vector to have a length (magnitude) of 1.\r\n     * Normalized vectors are often used as a direction vectors.\r\n     *\r\n     * @returns The normalized vector.\r\n     */\r\n    normalize(): Vec2 {\r\n        if (this.isZero()) {\r\n            Vec2.log.error(new Error('Cannot normalize zero-length vector'));\r\n            throw new Error('Cannot normalize zero-length vector');\r\n        }\r\n        const len = this.length();\r\n        return Vec2.from(this.x / len, this.y / len);\r\n    }\r\n    /**\r\n     * Computes the length (magnitude) of the vector.\r\n     *\r\n     * @returns The length of the vector.\r\n     */\r\n    length(): number {\r\n        return Math.sqrt(this.lengthSquared());\r\n    }\r\n    /**\r\n     * Computes the squared length of the vector.\r\n     * This is faster than computing the actual length and can be useful for comparison purposes.\r\n     *\r\n     * @returns The squared length of the vector.\r\n     */\r\n    lengthSquared(): number {\r\n        return this.x * this.x + this.y * this.y;\r\n    }\r\n    /**\r\n     * Computes the distance between the current vector and another vector.\r\n     *\r\n     * @param v - The other vector.\r\n     * @returns The distance between the two vectors.\r\n     */\r\n    distance(x: number, y: number): number;\r\n    distance(x: Vec2): number;\r\n    distance(x: Vector2): number;\r\n    distance(x: VectorXZ): number;\r\n    distance(x: Direction): number;\r\n    distance(x: number[]): number;\r\n    distance(x: VectorLike, y?: number): number {\r\n        const v: Vec2 = Vec2._from(x, y);\r\n        return Math.sqrt(this.distanceSquared(v));\r\n    }\r\n    /**\r\n     * Computes the squared distance between the current vector and another vector.\r\n     * This is faster than computing the actual distance and can be useful for comparison purposes.\r\n     *\r\n     * @param v - The other vector.\r\n     * @returns The squared distance between the two vectors.\r\n     */\r\n    distanceSquared(x: number, y: number): number;\r\n    distanceSquared(x: Vec2): number;\r\n    distanceSquared(x: Vector2): number;\r\n    distanceSquared(x: VectorXZ): number;\r\n    distanceSquared(x: Direction): number;\r\n    distanceSquared(x: number[]): number;\r\n    distanceSquared(x: VectorLike, y?: number): number {\r\n        const v: Vec2 = Vec2._from(x, y);\r\n        return this.subtract(v).lengthSquared();\r\n    }\r\n    /**\r\n     * Computes the linear interpolation between the current vector and another vector, when t is in the range [0, 1].\r\n     * Computes the extrapolation when t is outside this range.\r\n     *\r\n     * @param v - The other vector.\r\n     * @param t - The interpolation factor.\r\n     * @returns A new vector after performing the lerp operation.\r\n     */\r\n    lerp(v: Vector2, t: number): Vec2 {\r\n        if (!v || !t) return Vec2.from(this);\r\n        if (t === 1) return Vec2.from(v);\r\n        if (t === 0) return Vec2.from(this);\r\n        return Vec2.from(\r\n            this.x + (v.x - this.x) * t,\r\n            this.y + (v.y - this.y) * t\r\n        );\r\n    }\r\n    /**\r\n     * Computes the spherical linear interpolation between the current vector and another vector, when t is in the range [0, 1].\r\n     * Computes the extrapolation when t is outside this range.\r\n     *\r\n     * @param v - The other vector.\r\n     * @param t - The interpolation factor.\r\n     * @returns A new vector after performing the slerp operation.\r\n     */\r\n    slerp(v: Vector2, t: number): Vec2 {\r\n        if (!v || !t) return Vec2.from(this);\r\n        if (t === 1) return Vec2.from(v);\r\n        if (t === 0) return Vec2.from(this);\r\n        const dot = this.dot(v);\r\n        const theta = Math.acos(dot) * t;\r\n        const relative = Vec2.from(v).subtract(this.multiply(dot)).normalize();\r\n        return this.multiply(Math.cos(theta)).add(\r\n            relative.multiply(Math.sin(theta))\r\n        );\r\n    }\r\n    /**\r\n     * Computes the dot product of the current vector with another vector.\r\n     *\r\n     * @param v - The other vector.\r\n     * @returns The dot product of the two vectors.\r\n     */\r\n    dot(x: number, y: number): number;\r\n    dot(x: Vec2): number;\r\n    dot(x: Vector2): number;\r\n    dot(x: VectorXZ): number;\r\n    dot(x: Direction): number;\r\n    dot(x: number[]): number;\r\n    dot(x: VectorLike, y?: number): number {\r\n        const v: Vec2 = Vec2._from(x, y);\r\n        return this.x * v.x + this.y * v.y;\r\n    }\r\n    /**\r\n     * Computes the angle (in radians) between the current vector and another vector.\r\n     *\r\n     * @param v - The other vector.\r\n     * @returns The angle in radians between the two vectors.\r\n     */\r\n    angleBetween(x: number, y: number): number;\r\n    angleBetween(x: Vec2): number;\r\n    angleBetween(x: Vector2): number;\r\n    angleBetween(x: Direction): number;\r\n    angleBetween(x: number[]): number;\r\n    angleBetween(x: VectorLike, y?: number): number {\r\n        const v: Vec2 = Vec2._from(x, y);\r\n        const dotProduct = this.dot(v);\r\n        const lengths = this.length() * v.length();\r\n        if (lengths === 0) {\r\n            return 0;\r\n        }\r\n        return Math.acos(dotProduct / lengths);\r\n    }\r\n    /**\r\n     * Computes the projection of the current vector onto another vector.\r\n     * This method finds how much of the current vector lies in the direction of vector `v`.\r\n     *\r\n     * @param v - The vector onto which the current vector will be projected.\r\n     * @returns A new vector representing the projection of the current vector onto `v`.\r\n     */\r\n    projectOnto(x: number, y: number): Vec2;\r\n    projectOnto(x: Vec2): Vec2;\r\n    projectOnto(x: Vector2): Vec2;\r\n    projectOnto(x: VectorXZ): Vec2;\r\n    projectOnto(x: Direction): Vec2;\r\n    projectOnto(x: number[]): Vec2;\r\n    projectOnto(x: VectorLike, y?: number): Vec2 {\r\n        const v: Vec2 = Vec2._from(x, y);\r\n        // If the vector is zero-length, then the projection is the zero vector.\r\n        if (v.isZero()) {\r\n            return Vec2.Zero;\r\n        }\r\n        return v.scale(this.dot(v) / v.dot(v));\r\n    }\r\n    /**\r\n     * Computes the reflection of the current vector against a normal vector.\r\n     * Useful for simulating light reflections or bouncing objects.\r\n     *\r\n     * @param normal - The normal vector against which the current vector will be reflected.\r\n     * @returns A new vector representing the reflection of the current vector.\r\n     */\r\n    reflect(x: number, y: number): Vec2;\r\n    reflect(x: Vec2): Vec2;\r\n    reflect(x: Vector2): Vec2;\r\n    reflect(x: VectorXZ): Vec2;\r\n    reflect(x: Direction): Vec2;\r\n    reflect(x: number[]): Vec2;\r\n    reflect(x: VectorLike, y?: number): Vec2 {\r\n        const normal: Vec2 = Vec2._from(x, y);\r\n        const proj = this.projectOnto(normal);\r\n        return this.subtract(proj.multiply(2));\r\n    }\r\n    /**\r\n     * Converts the current vector to a 3d vetor with the given y-value.\r\n     *\r\n     * @param z - The optional z value for the 3d vetor.\r\n     * @returns The converted vector.\r\n     */\r\n    toVec3(z?: number): Vec3 {\r\n        return new Vec3(this.x, this.y, z || 0);\r\n    }\r\n    /**\r\n     * Sets the X component of the vector.\r\n     *\r\n     * @param value - The new X value.\r\n     * @returns The updated vector with the new X value.\r\n     */\r\n    setX(value: number): Vec2 {\r\n        return new Vec2(value, this.y);\r\n    }\r\n    /**\r\n     * Sets the Y component of the vector.\r\n     *\r\n     * @param value - The new Y value.\r\n     * @returns The updated vector with the new Y value.\r\n     */\r\n    setY(value: number): Vec2 {\r\n        return new Vec2(this.x, value);\r\n    }\r\n    /**\r\n     * Calculates the shortest distance between a point (represented by this Vector3 instance) and a line segment.\r\n     *\r\n     * This method finds the perpendicular projection of the point onto the line defined by the segment. If this\r\n     * projection lies outside the line segment, then the method calculates the distance from the point to the\r\n     * nearest segment endpoint.\r\n     *\r\n     * @param start - The starting point of the line segment.\r\n     * @param end - The ending point of the line segment.\r\n     * @returns The shortest distance between the point and the line segment.\r\n     */\r\n    distanceToLineSegment(start: Vector2, end: Vector2): number {\r\n        const lineDirection = Vec2.from(end).subtract(start);\r\n        // If the line is zero-length, then the distance is the distance to the start point.\r\n        if (lineDirection.lengthSquared() === 0) {\r\n            return this.subtract(start).length();\r\n        }\r\n        const t = Math.max(\r\n            0,\r\n            Math.min(\r\n                1,\r\n                this.subtract(start).dot(lineDirection) /\r\n                    lineDirection.dot(lineDirection)\r\n            )\r\n        );\r\n        const projection = Vec2.from(start).add(lineDirection.multiply(t));\r\n        return this.subtract(projection).length();\r\n    }\r\n    /**\r\n     * Floors the X, Y, and Z components of the vector.\r\n     * @returns A new vector with the floored components.\r\n     */\r\n    floor(): Vec2 {\r\n        return new Vec2(Math.floor(this.x), Math.floor(this.y));\r\n    }\r\n    /**\r\n     * Floors the X component of the vector.\r\n     * @returns A new vector with the floored X component.\r\n     */\r\n    floorX(): Vec2 {\r\n        return new Vec2(Math.floor(this.x), this.y);\r\n    }\r\n    /**\r\n     * Floors the Y component of the vector.\r\n     * @returns A new vector with the floored Y component.\r\n     */\r\n    floorY(): Vec2 {\r\n        return new Vec2(this.x, Math.floor(this.y));\r\n    }\r\n    /**\r\n     * Ceils the X, Y, and Z components of the vector.\r\n     * @returns A new vector with the ceiled components.\r\n     */\r\n    ceil(): Vec2 {\r\n        return new Vec2(Math.ceil(this.x), Math.ceil(this.y));\r\n    }\r\n    /**\r\n     * Ceils the X component of the vector.\r\n     * @returns A new vector with the ceiled X component.\r\n     */\r\n    ceilX(): Vec2 {\r\n        return new Vec2(Math.ceil(this.x), this.y);\r\n    }\r\n    /**\r\n     * Ceils the Y component of the vector.\r\n     * @returns A new vector with the ceiled Y component.\r\n     */\r\n    ceilY(): Vec2 {\r\n        return new Vec2(this.x, Math.ceil(this.y));\r\n    }\r\n    /**\r\n     * Rounds the X, Y, and Z components of the vector.\r\n     * @returns A new vector with the rounded components.\r\n     */\r\n    round(): Vec2 {\r\n        return new Vec2(Math.round(this.x), Math.round(this.y));\r\n    }\r\n    /**\r\n     * Rounds the X component of the vector.\r\n     * @returns A new vector with the rounded X component.\r\n     */\r\n    roundX(): Vec2 {\r\n        return new Vec2(Math.round(this.x), this.y);\r\n    }\r\n    /**\r\n     * Rounds the Y component of the vector.\r\n     * @returns A new vector with the rounded Y component.\r\n     */\r\n    roundY(): Vec2 {\r\n        return new Vec2(this.x, Math.round(this.y));\r\n    }\r\n    /**\r\n     * Returns a new vector offset from the current vector north by 1 block.\r\n     * @returns A new vector offset from the current vector north by 1 block.\r\n     */\r\n    north(): Vec2 {\r\n        return this.add(Vec2.North);\r\n    }\r\n    /**\r\n     * Returns a new vector offset from the current vector south by 1 block.\r\n     * @returns A new vector offset from the current vector south by 1 block.\r\n     */\r\n    south(): Vec2 {\r\n        return this.add(Vec2.South);\r\n    }\r\n    /**\r\n     * Returns a new vector offset from the current vector east by 1 block.\r\n     * @returns A new vector offset from the current vector east by 1 block.\r\n     */\r\n    east(): Vec2 {\r\n        return this.add(Vec2.East);\r\n    }\r\n    /**\r\n     * Returns a new vector offset from the current vector west by 1 block.\r\n     * @returns A new vector offset from the current vector west by 1 block.\r\n     */\r\n    west(): Vec2 {\r\n        return this.add(Vec2.West);\r\n    }\r\n    /**\r\n     * Checks if the current vector is equal to the zero vector.\r\n     * @returns true if the vector is equal to the zero vector, else returns false.\r\n     */\r\n    isZero(): boolean {\r\n        return this.x === 0 && this.y === 0;\r\n    }\r\n    /**\r\n     * Converts the vector to an array containing the X, Y, and Z components of the vector.\r\n     * @returns An array containing the X, Y, and Z components of the vector.\r\n     */\r\n    toArray(): number[] {\r\n        return [this.x, this.y];\r\n    }\r\n    /**\r\n     * Converts the vector to a direction.\r\n     * If the vector is not a unit vector, then it will be normalized and rounded to the nearest direction.\r\n     */\r\n    toDirection(): Direction {\r\n        if (this.isZero()) {\r\n            Vec2.log.error(\r\n                new Error('Cannot convert zero-length vector to direction')\r\n            );\r\n            throw new Error('Cannot convert zero-length vector to direction');\r\n        }\r\n        const normalized = this.normalize();\r\n        const maxValue = Math.max(\r\n            Math.abs(normalized.x),\r\n            Math.abs(normalized.y)\r\n        );\r\n        if (maxValue === normalized.x) return Direction.East;\r\n        if (maxValue === -normalized.x) return Direction.West;\r\n        if (maxValue === normalized.y) return Direction.North;\r\n        if (maxValue === -normalized.y) return Direction.South;\r\n        // This should never happen\r\n        Vec2.log.error(new Error('Cannot convert vector to direction'), this);\r\n        throw new Error('Cannot convert vector to direction');\r\n    }\r\n    /**\r\n     * Returns a new vector with the X, Y, and Z components rounded to the nearest block location.\r\n     */\r\n    toBlockLocation(): Vec2 {\r\n        // At this point I'm not sure if it wouldn't be better to use Math.floor instead\r\n        return Vec2.from(\r\n            (this.x << 0) - (this.x < 0 && this.x !== this.x << 0 ? 1 : 0),\r\n            (this.y << 0) - (this.y < 0 && this.y !== this.y << 0 ? 1 : 0)\r\n        );\r\n    }\r\n    /**\r\n     * Checks if the current vector is equal to another vector.\r\n     * @param other\r\n     */\r\n    almostEqual(x: number, y: number, delta: number): boolean;\r\n    almostEqual(x: Vec2, delta: number): boolean;\r\n    almostEqual(x: Vector2, delta: number): boolean;\r\n    almostEqual(x: VectorXZ, delta: number): boolean;\r\n    almostEqual(x: Direction, delta: number): boolean;\r\n    almostEqual(x: number[], delta: number): boolean;\r\n    almostEqual(x: VectorLike, y: number, delta?: number) {\r\n        try {\r\n            let other: Vec2;\r\n            if (typeof x !== 'number' && delta === undefined) {\r\n                other = Vec2._from(x, undefined);\r\n                delta = y!;\r\n            } else {\r\n                other = Vec2._from(x, y);\r\n            }\r\n            return (\r\n                Math.abs(this.x - other.x) <= delta! &&\r\n                Math.abs(this.y - other.y) <= delta!\r\n            );\r\n        } catch (e) {\r\n            return false;\r\n        }\r\n    }\r\n    /**\r\n     * Checks if the current vector is equal to another vector.\r\n     * @param other\r\n     */\r\n    equals(x: number, y: number): boolean;\r\n    equals(x: Vec2): boolean;\r\n    equals(x: Vector2): boolean;\r\n    equals(x: VectorXZ): boolean;\r\n    equals(x: Direction): boolean;\r\n    equals(x: number[]): boolean;\r\n    equals(x: VectorLike, y?: number) {\r\n        try {\r\n            const other: Vec2 = Vec2._from(x, y);\r\n            return this.x === other.x && this.y === other.y;\r\n        } catch (e) {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    toString(\r\n        format: 'long' | 'short' = 'long',\r\n        separator: string = ', '\r\n    ): string {\r\n        const result = `${this.x + separator + this.y}`;\r\n        return format === 'long' ? `Vec2(${result})` : result;\r\n    }\r\n}\r\n","import { Vector2, Direction, VectorXZ } from '@minecraft/server';\r\nimport Vec3 from './Vec3';\r\nimport Vec2 from './Vec2';\r\n\r\n// Mirrors Vec2 constructor flexibility, but this class mutates itself for vector math.\r\ntype VectorLike =\r\n    | VectorXZ\r\n    | Vector2\r\n    | Vec2\r\n    | MutVec2\r\n    | Direction\r\n    | number[]\r\n    | number;\r\n\r\nexport default class MutVec2 implements Vector2 {\r\n    x: number;\r\n    y: number;\r\n\r\n    constructor(x: number, y: number);\r\n    constructor(x: MutVec2);\r\n    constructor(x: Vec2);\r\n    constructor(x: Vector2);\r\n    constructor(x: VectorXZ);\r\n    constructor(x: Direction);\r\n    constructor(x: number[]);\r\n    constructor(x: VectorLike, y?: number) {\r\n        if (x === Direction.Down || x === Direction.Up) {\r\n            throw new Error('Invalid direction');\r\n        } else if (x === Direction.North) {\r\n            this.x = 0;\r\n            this.y = 1;\r\n        } else if (x === Direction.South) {\r\n            this.x = 0;\r\n            this.y = -1;\r\n        } else if (x === Direction.East) {\r\n            this.x = 1;\r\n            this.y = 0;\r\n        } else if (x === Direction.West) {\r\n            this.x = -1;\r\n            this.y = 0;\r\n        } else if (typeof x === 'number') {\r\n            if (y === undefined) {\r\n                throw new Error('Invalid vector');\r\n            }\r\n            this.x = x;\r\n            this.y = y;\r\n        } else if (Array.isArray(x)) {\r\n            this.x = x[0];\r\n            this.y = x[1];\r\n        } else if (x instanceof MutVec2 || x instanceof Vec2) {\r\n            this.x = x.x;\r\n            this.y = x.y;\r\n        } else {\r\n            const anyX = x as any;\r\n            if (\r\n                !anyX ||\r\n                (!anyX.x && anyX.x !== 0) ||\r\n                (!anyX.y && anyX.y !== 0 && !anyX.z && anyX.z !== 0)\r\n            ) {\r\n                throw new Error('Invalid vector');\r\n            }\r\n            this.x = anyX.x;\r\n            if (anyX.y || anyX.y === 0) {\r\n                this.y = anyX.y;\r\n            } else if (anyX.z || anyX.z === 0) {\r\n                this.y = anyX.z;\r\n            } else {\r\n                throw new Error('Invalid vector');\r\n            }\r\n        }\r\n    }\r\n\r\n    static from(x: number, y: number): MutVec2;\r\n    static from(x: MutVec2): MutVec2;\r\n    static from(x: Vec2): MutVec2;\r\n    static from(x: Vector2): MutVec2;\r\n    static from(x: VectorXZ): MutVec2;\r\n    static from(x: Direction): MutVec2;\r\n    static from(x: number[]): MutVec2;\r\n    static from(x: VectorLike, y?: number): MutVec2 {\r\n        if (x instanceof MutVec2) return new MutVec2(x);\r\n        if (x instanceof Vec2) return new MutVec2(x);\r\n        if (typeof x === 'number' && y !== undefined) return new MutVec2(x, y);\r\n        if (Array.isArray(x)) return new MutVec2(x);\r\n        if (x === Direction.Down || x === Direction.Up) {\r\n            throw new Error('Invalid direction');\r\n        }\r\n        if (x === Direction.North) return new MutVec2(Direction.North);\r\n        if (x === Direction.South) return new MutVec2(Direction.South);\r\n        if (x === Direction.East) return new MutVec2(Direction.East);\r\n        if (x === Direction.West) return new MutVec2(Direction.West);\r\n        return new MutVec2(x as any, y as any);\r\n    }\r\n\r\n    private static _from(x: VectorLike, y?: number): MutVec2 {\r\n        if (typeof x === 'number' && y === undefined) {\r\n            return new MutVec2(x, x)\r\n        }\r\n        if (x instanceof MutVec2) return x;\r\n        if (x instanceof Vec2) return new MutVec2(x);\r\n        if (typeof x === 'number' && y !== undefined) return new MutVec2(x, y);\r\n        if (Array.isArray(x)) return new MutVec2(x);\r\n        if (x === Direction.Down || x === Direction.Up) {\r\n            throw new Error('Invalid direction');\r\n        }\r\n        if (x === Direction.North) return new MutVec2(Direction.North);\r\n        if (x === Direction.South) return new MutVec2(Direction.South);\r\n        if (x === Direction.East) return new MutVec2(Direction.East);\r\n        if (x === Direction.West) return new MutVec2(Direction.West);\r\n        return new MutVec2(x as any, y as any);\r\n    }\r\n\r\n    copy(): MutVec2 {\r\n        return new MutVec2(this.x, this.y);\r\n    }\r\n\r\n    toImmutable(): Vec2 {\r\n        return new Vec2(this.x, this.y);\r\n    }\r\n\r\n    static fromYaw(yaw: number): MutVec2 {\r\n        const psi = yaw * (Math.PI / 180);\r\n        const x = Math.sin(psi);\r\n        const z = Math.cos(psi);\r\n        return new MutVec2(x, z);\r\n    }\r\n\r\n    toYaw(): number {\r\n        if (this.isZero()) {\r\n            throw new Error('Cannot convert zero-length vector to direction');\r\n        }\r\n        const direction = this.copy().normalize();\r\n        return Math.atan2(direction.x, direction.y) * (180 / Math.PI);\r\n    }\r\n\r\n    add(x: number, y: number): MutVec2;\r\n    add(x: MutVec2): MutVec2;\r\n    add(x: Vec2): MutVec2;\r\n    add(x: Vector2): MutVec2;\r\n    add(x: VectorXZ): MutVec2;\r\n    add(x: Direction): MutVec2;\r\n    add(x: number[]): MutVec2;\r\n    add(x: number): MutVec2;\r\n    add(x: VectorLike, y?: number): MutVec2 {\r\n        const v = MutVec2._from(x, y);\r\n        this.x += v.x;\r\n        this.y += v.y;\r\n        return this;\r\n    }\r\n\r\n    directionTo(x: number, y: number): MutVec2;\r\n    directionTo(x: MutVec2): MutVec2;\r\n    directionTo(x: Vec2): MutVec2;\r\n    directionTo(x: Vector2): MutVec2;\r\n    directionTo(x: VectorXZ): MutVec2;\r\n    directionTo(x: Direction): MutVec2;\r\n    directionTo(x: number[]): MutVec2;\r\n    directionTo(x: VectorLike, y?: number): MutVec2 {\r\n        const v = MutVec2._from(x, y);\r\n        v.subtract(this).normalize();\r\n        return this;\r\n    }\r\n\r\n    subtract(x: number, y: number): MutVec2;\r\n    subtract(x: MutVec2): MutVec2;\r\n    subtract(x: Vec2): MutVec2;\r\n    subtract(x: Vector2): MutVec2;\r\n    subtract(x: VectorXZ): MutVec2;\r\n    subtract(x: Direction): MutVec2;\r\n    subtract(x: number[]): MutVec2;\r\n    subtract(x: number): MutVec2;\r\n    subtract(x: VectorLike, y?: number): MutVec2 {\r\n        const v = MutVec2._from(x, y);\r\n        this.x -= v.x;\r\n        this.y -= v.y;\r\n        return this;\r\n    }\r\n\r\n    multiply(x: number, y: number): MutVec2;\r\n    multiply(x: MutVec2): MutVec2;\r\n    multiply(x: Vec2): MutVec2;\r\n    multiply(x: Vector2): MutVec2;\r\n    multiply(x: VectorXZ): MutVec2;\r\n    multiply(x: Direction): MutVec2;\r\n    multiply(x: number[]): MutVec2;\r\n    multiply(x: number): MutVec2;\r\n    multiply(x: VectorLike, y?: number): MutVec2 {\r\n        if (typeof x === 'number' && y === undefined) {\r\n            this.x *= x;\r\n            this.y *= x;\r\n            return this;\r\n        }\r\n        const v = MutVec2._from(x, y);\r\n        this.x *= v.x;\r\n        this.y *= v.y;\r\n        return this;\r\n    }\r\n\r\n    scale(scalar: number): MutVec2 {\r\n        this.x *= scalar;\r\n        this.y *= scalar;\r\n        return this;\r\n    }\r\n\r\n    divide(x: number, y: number): MutVec2;\r\n    divide(x: MutVec2): MutVec2;\r\n    divide(x: Vec2): MutVec2;\r\n    divide(x: Vector2): MutVec2;\r\n    divide(x: VectorXZ): MutVec2;\r\n    divide(x: Direction): MutVec2;\r\n    divide(x: number[]): MutVec2;\r\n    divide(x: number): MutVec2;\r\n    divide(x: VectorLike, y?: number): MutVec2 {\r\n        if (typeof x === 'number' && y === undefined) {\r\n            if (x === 0) throw new Error('Cannot divide by zero');\r\n            this.x /= x;\r\n            this.y /= x;\r\n            return this;\r\n        }\r\n        const v = MutVec2._from(x, y);\r\n        if (v.x === 0 || v.y === 0) throw new Error('Cannot divide by zero');\r\n        this.x /= v.x;\r\n        this.y /= v.y;\r\n        return this;\r\n    }\r\n\r\n    normalize(): MutVec2 {\r\n        if (this.isZero()) {\r\n            throw new Error('Cannot normalize zero-length vector');\r\n        }\r\n        const len = this.length();\r\n        this.x /= len;\r\n        this.y /= len;\r\n        return this;\r\n    }\r\n\r\n    length(): number {\r\n        return Math.hypot(this.x, this.y);\r\n    }\r\n\r\n    lengthSquared(): number {\r\n        return this.x * this.x + this.y * this.y;\r\n    }\r\n\r\n    distance(x: number, y: number): number;\r\n    distance(x: MutVec2): number;\r\n    distance(x: Vec2): number;\r\n    distance(x: Vector2): number;\r\n    distance(x: VectorXZ): number;\r\n    distance(x: Direction): number;\r\n    distance(x: number[]): number;\r\n    distance(x: VectorLike, y?: number): number {\r\n        const v = MutVec2._from(x, y);\r\n        return this.copy().subtract(v).length();\r\n    }\r\n\r\n    distanceSquared(x: number, y: number): number;\r\n    distanceSquared(x: MutVec2): number;\r\n    distanceSquared(x: Vec2): number;\r\n    distanceSquared(x: Vector2): number;\r\n    distanceSquared(x: VectorXZ): number;\r\n    distanceSquared(x: Direction): number;\r\n    distanceSquared(x: number[]): number;\r\n    distanceSquared(x: VectorLike, y?: number): number {\r\n        const v = MutVec2._from(x, y);\r\n        return this.copy().subtract(v).lengthSquared();\r\n    }\r\n\r\n    lerp(v: Vector2, t: number): MutVec2 {\r\n        if (!v || t === undefined) return this;\r\n        if (t === 1) {\r\n            this.x = v.x;\r\n            this.y = v.y;\r\n            return this;\r\n        }\r\n        if (t === 0) return this;\r\n        this.x = this.x + (v.x - this.x) * t;\r\n        this.y = this.y + (v.y - this.y) * t;\r\n        return this;\r\n    }\r\n\r\n    slerp(v: Vector2, t: number): MutVec2 {\r\n        if (!v || t === undefined) return this;\r\n        if (t === 1) {\r\n            this.x = v.x;\r\n            this.y = v.y;\r\n            return this;\r\n        }\r\n        if (t === 0) return this;\r\n        const dot = this.dot(v);\r\n        const theta = Math.acos(dot) * t;\r\n        const relative = MutVec2.from(v)\r\n            .subtract(this.copy().multiply(dot))\r\n            .normalize();\r\n        const cosT = Math.cos(theta);\r\n        const sinT = Math.sin(theta);\r\n        this.multiply(cosT);\r\n        this.x += relative.x * sinT;\r\n        this.y += relative.y * sinT;\r\n        return this;\r\n    }\r\n\r\n    dot(x: number, y: number): number;\r\n    dot(x: MutVec2): number;\r\n    dot(x: Vec2): number;\r\n    dot(x: Vector2): number;\r\n    dot(x: VectorXZ): number;\r\n    dot(x: Direction): number;\r\n    dot(x: number[]): number;\r\n    dot(x: VectorLike, y?: number): number {\r\n        const v = MutVec2._from(x, y);\r\n        return this.x * v.x + this.y * v.y;\r\n    }\r\n\r\n    angleBetween(x: number, y: number): number;\r\n    angleBetween(x: MutVec2): number;\r\n    angleBetween(x: Vec2): number;\r\n    angleBetween(x: Vector2): number;\r\n    angleBetween(x: Direction): number;\r\n    angleBetween(x: number[]): number;\r\n    angleBetween(x: VectorLike, y?: number): number {\r\n        const v = MutVec2._from(x, y);\r\n        const dotProduct = this.dot(v);\r\n        const lengths = this.length() * v.length();\r\n        if (lengths === 0) {\r\n            return 0;\r\n        }\r\n        return Math.acos(dotProduct / lengths);\r\n    }\r\n\r\n    projectOnto(x: number, y: number): MutVec2;\r\n    projectOnto(x: MutVec2): MutVec2;\r\n    projectOnto(x: Vec2): MutVec2;\r\n    projectOnto(x: Vector2): MutVec2;\r\n    projectOnto(x: VectorXZ): MutVec2;\r\n    projectOnto(x: Direction): MutVec2;\r\n    projectOnto(x: number[]): MutVec2;\r\n    projectOnto(x: VectorLike, y?: number): MutVec2 {\r\n        const v = MutVec2._from(x, y);\r\n        if (v.isZero()) {\r\n            this.x = 0;\r\n            this.y = 0;\r\n            return this;\r\n        }\r\n        const scale = this.dot(v) / v.dot(v);\r\n        this.x = v.x * scale;\r\n        this.y = v.y * scale;\r\n        return this;\r\n    }\r\n\r\n    reflect(x: number, y: number): MutVec2;\r\n    reflect(x: MutVec2): MutVec2;\r\n    reflect(x: Vec2): MutVec2;\r\n    reflect(x: Vector2): MutVec2;\r\n    reflect(x: VectorXZ): MutVec2;\r\n    reflect(x: Direction): MutVec2;\r\n    reflect(x: number[]): MutVec2;\r\n    reflect(x: VectorLike, y?: number): MutVec2 {\r\n        const normal = MutVec2._from(x, y);\r\n        const projection = this.copy().projectOnto(normal);\r\n        return this.subtract(projection.multiply(2));\r\n    }\r\n\r\n    toVec3(z?: number): Vec3 {\r\n        return new Vec3(this.x, this.y, z || 0);\r\n    }\r\n\r\n    setX(value: number): MutVec2;\r\n    setX(value: (x: number) => number): MutVec2;\r\n    setX(value: number | ((x: number) => number)): MutVec2 {\r\n        if (typeof value === 'number') {\r\n            this.x = value;\r\n        } else {\r\n            this.x = value(this.x);\r\n        }\r\n        return this;\r\n    }\r\n\r\n    setY(value: number): MutVec2;\r\n    setY(value: (y: number) => number): MutVec2;\r\n    setY(value: number | ((y: number) => number)): MutVec2 {\r\n        if (typeof value === 'number') {\r\n            this.y = value;\r\n        } else {\r\n            this.y = value(this.y);\r\n        }\r\n        return this;\r\n    }\r\n\r\n    update(\r\n        x: ((x: number) => number) | undefined,\r\n        y: ((y: number) => number) | undefined\r\n    ): MutVec2 {\r\n        if (!x) x = (v: number) => v;\r\n        if (!y) y = (v: number) => v;\r\n        this.x = x(this.x);\r\n        this.y = y(this.y);\r\n        return this;\r\n    }\r\n\r\n    floor(): MutVec2 {\r\n        return this.update(Math.floor, Math.floor);\r\n    }\r\n\r\n    floorX(): MutVec2 {\r\n        return this.setX(Math.floor);\r\n    }\r\n\r\n    floorY(): MutVec2 {\r\n        return this.setY(Math.floor);\r\n    }\r\n\r\n    ceil(): MutVec2 {\r\n        return this.update(Math.ceil, Math.ceil);\r\n    }\r\n\r\n    ceilX(): MutVec2 {\r\n        return this.setX(Math.ceil);\r\n    }\r\n\r\n    ceilY(): MutVec2 {\r\n        return this.setY(Math.ceil);\r\n    }\r\n\r\n    round(): MutVec2 {\r\n        return this.update(Math.round, Math.round);\r\n    }\r\n\r\n    roundX(): MutVec2 {\r\n        return this.setX(Math.round);\r\n    }\r\n\r\n    roundY(): MutVec2 {\r\n        return this.setY(Math.round);\r\n    }\r\n\r\n    north(): MutVec2 {\r\n        return this.add(Direction.North);\r\n    }\r\n\r\n    south(): MutVec2 {\r\n        return this.add(Direction.South);\r\n    }\r\n\r\n    east(): MutVec2 {\r\n        return this.add(Direction.East);\r\n    }\r\n\r\n    west(): MutVec2 {\r\n        return this.add(Direction.West);\r\n    }\r\n\r\n    isZero(): boolean {\r\n        return this.x === 0 && this.y === 0;\r\n    }\r\n\r\n    toArray(): number[] {\r\n        return [this.x, this.y];\r\n    }\r\n\r\n    toDirection(): Direction {\r\n        if (this.isZero()) {\r\n            throw new Error('Cannot convert zero-length vector to direction');\r\n        }\r\n        const normalized = this.copy().normalize();\r\n        const maxValue = Math.max(\r\n            Math.abs(normalized.x),\r\n            Math.abs(normalized.y)\r\n        );\r\n        if (maxValue === normalized.x) return Direction.East;\r\n        if (maxValue === -normalized.x) return Direction.West;\r\n        if (maxValue === normalized.y) return Direction.North;\r\n        if (maxValue === -normalized.y) return Direction.South;\r\n        throw new Error('Cannot convert vector to direction');\r\n    }\r\n\r\n    toBlockLocation(): MutVec2 {\r\n        const blockX =\r\n            (this.x << 0) - (this.x < 0 && this.x !== this.x << 0 ? 1 : 0);\r\n        const blockY =\r\n            (this.y << 0) - (this.y < 0 && this.y !== this.y << 0 ? 1 : 0);\r\n        this.x = blockX;\r\n        this.y = blockY;\r\n        return this;\r\n    }\r\n\r\n    almostEqual(x: number, y: number, delta: number): boolean;\r\n    almostEqual(x: MutVec2, delta: number): boolean;\r\n    almostEqual(x: Vec2, delta: number): boolean;\r\n    almostEqual(x: Vector2, delta: number): boolean;\r\n    almostEqual(x: VectorXZ, delta: number): boolean;\r\n    almostEqual(x: Direction, delta: number): boolean;\r\n    almostEqual(x: number[], delta: number): boolean;\r\n    almostEqual(x: VectorLike, y: number, delta?: number): boolean {\r\n        try {\r\n            let other: MutVec2;\r\n            if (typeof x !== 'number' && delta === undefined) {\r\n                other = MutVec2._from(x, undefined);\r\n                delta = y;\r\n            } else {\r\n                other = MutVec2._from(x, y);\r\n            }\r\n            return (\r\n                Math.abs(this.x - other.x) <= delta! &&\r\n                Math.abs(this.y - other.y) <= delta!\r\n            );\r\n        } catch (e) {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    equals(x: number, y: number): boolean;\r\n    equals(x: MutVec2): boolean;\r\n    equals(x: Vec2): boolean;\r\n    equals(x: Vector2): boolean;\r\n    equals(x: VectorXZ): boolean;\r\n    equals(x: Direction): boolean;\r\n    equals(x: number[]): boolean;\r\n    equals(x: VectorLike, y?: number): boolean {\r\n        try {\r\n            const other = MutVec2._from(x, y);\r\n            return this.x === other.x && this.y === other.y;\r\n        } catch (e) {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    toString(\r\n        format: 'long' | 'short' = 'long',\r\n        separator: string = ', '\r\n    ): string {\r\n        const result = `${this.x + separator + this.y}`;\r\n        return format === 'long' ? `MutVec2(${result})` : result;\r\n    }\r\n}\r\n","import { Logger } from './Logging';\n/**\n * A simple class to measure the time it takes to perform an operation.\n */\nexport default class Timings {\n    private static readonly log = Logger.getLogger('Timings', 'timings');\n    static lastTime = -1;\n    static lastOperation = '';\n\n    /**\n     * Begin measuring the time it takes to perform an operation.\n     * @remarks\n     * If another operation is already being measured, the measurement will be ended.\n     *\n     * @param operation The name of the operation.\n     */\n    static begin(operation: string) {\n        this.end();\n        this.lastTime = new Date().getTime();\n        this.lastOperation = operation;\n    }\n\n    /**\n     * End measuring the time it takes to perform an operation and log the result.\n     * @remarks\n     * If no operation is being measured, this method will do nothing.\n     */\n    static end() {\n        const time = new Date().getTime();\n        if (this.lastTime > 0) {\n            Timings.log.debug(\n                `Operation ${this.lastOperation} took ${time - this.lastTime}ms`\n            );\n        }\n        this.lastTime = -1;\n    }\n}\n","import { NumberRange } from '@minecraft/common';\nimport { BlockPermutation, Dimension, world } from '@minecraft/server';\n\nconst dimensions: { [key: string]: Dimension } = {};\n\nconst dimensionHeightRanges: { [key: string]: NumberRange } = {};\n\nconst permutations: { [key: string]: BlockPermutation } = {};\n\n/**\n * Returns a dimension from the cache or gets it from the API and caches it.\n * @param name The name of the dimension.\n * @returns The dimension.\n */\nexport function getDimension(name: string) {\n    if (dimensions[name]) return dimensions[name];\n    return (dimensions[name] = world.getDimension(name));\n}\n\n/**\n * Returns a dimension height range from the cache or gets it from the API and caches it.\n * @param name The name of the dimension.\n * @returns The dimension height range.\n */\nexport function getDimensionHeightRange(name: string) {\n    if (dimensionHeightRanges[name]) return dimensionHeightRanges[name];\n    return (dimensionHeightRanges[name] = getDimension(name).heightRange);\n}\n\n/**\n * Returns a block permutation from the cache or gets it from the API and caches it.\n * @param blockName The name of the block.\n * @param states The block states.\n * @returns The block permutation.\n */\nexport function getBlockPermutation(\n    blockName: string,\n    states?: Record<string, boolean | number | string>\n): BlockPermutation {\n    const key = `${blockName}:${JSON.stringify(states)}`;\n    if (permutations[key]) return permutations[key];\n    return (permutations[key] = BlockPermutation.resolve(blockName, states));\n}\n","import { world } from '@minecraft/server';\nimport { install as playerInstall } from './PlayerPolyfill';\n\nexport default class Polyfill {\n    private static _installed: Map<string, boolean> = new Map<\n        string,\n        boolean\n    >();\n    /**\n     * Installs the polyfill for the console.\n     *\n     * This polyfill makes `console.log` send a message to the world chat.\n     */\n    public static installConsole(): void {\n        if (this._installed.get('console')) return;\n        this._installed.set('console', true);\n        (console as any).originalLog = console.log;\n        console.log = (...args: any[]) => {\n            (console as any).originalLog(...args);\n            const message = args.join(' ');\n            world.sendMessage(message);\n        };\n    }\n    /**\n     * Installs the polyfill for the player.\n     *\n     * This polyfill adds the following methods to the player:\n     * - applyImpulse\n     * - clearVelocity\n     */\n    public static installPlayer(): void {\n        if (this._installed.get('player')) return;\n        this._installed.set('player', true);\n        playerInstall();\n    }\n}\n","import { Entity, Player, Vector3 } from '@minecraft/server';\n\n/**\n * Applies an impulse to a player.\n * @param player The player to apply the impulse to.\n * @param vector The vector of the impulse.\n *\n * @author https://github.com/SIsilicon (https://github.com/JaylyDev/ScriptAPI/tree/main/scripts/player-impulse)\n */\n// function applyImpulse(player: Player, vector: Vector3) {\n//   const { x, y, z } = vector;\n//   const horizontal = Math.sqrt(x * x + z * z) * 2.0;\n//   const vertical = y < 0.0 ? 0.5 * y : y;\n//   player.applyKnockback(x, z, horizontal, vertical);\n// }\n\n/**\n * New implementation of applyImpulse. This one tries to replicate the behavior of\n * the normal impulse as much as possible.\n * @param entity The entity to apply the impulse to.\n * @param vector The vector of the impulse.\n */\nfunction applyImpulseNew(entity: Entity, vector: Vector3) {\n    const { x, y, z } = vector;\n    const previousVelocity = entity.getVelocity();\n\n    // Calculate the norm (magnitude) of the horizontal components (x and z)\n    const horizontalNorm = Math.sqrt(x * x + z * z);\n\n    // Calculate directionX and directionZ as normalized values\n    let directionX = 0;\n    let directionZ = 0;\n    if (horizontalNorm !== 0) {\n        directionX = x / horizontalNorm;\n        directionZ = z / horizontalNorm;\n    }\n\n    // The horizontalStrength is the horizontal norm of the input vector\n    // multiplied by 2.5 based on experimentation\n    const horizontalStrength = horizontalNorm * 2.5;\n\n    // The vertical component is directly taken as verticalStrength\n    // The previous velocity is also taken into account, because normal impulse retains\n    // the previous velocity and knockback does not\n    const verticalStrength = y + previousVelocity.y * 0.9;\n\n    // Apply the knockback\n    entity.applyKnockback(\n        {\n            x: horizontalStrength * directionX,\n            z: horizontalStrength * directionZ,\n        },\n        verticalStrength\n    );\n}\n\n/**\n * Clears the velocity of an entity. This applies a knockback with the opposite\n * direction and the same strength as the current velocity in horizontal direction.\n * @param entity The entity to clear the velocity of.\n */\nfunction clearVelocity(entity: Entity) {\n    const { x, z } = entity.getVelocity();\n\n    // Calculate the norm (magnitude) of the horizontal components (x and z)\n    const horizontalNorm = Math.sqrt(x * x + z * z);\n\n    // Calculate directionX and directionZ as normalized values\n    let directionX = 0;\n    let directionZ = 0;\n    if (horizontalNorm !== 0) {\n        directionX = -x / horizontalNorm;\n        directionZ = -z / horizontalNorm;\n    }\n\n    // Apply the knockback\n    entity.applyKnockback(\n        {\n            x: horizontalNorm * directionX,\n            z: horizontalNorm * directionZ,\n        },\n        0\n    );\n}\n\nexport function install() {\n    Player.prototype.applyImpulse = function (vector: Vector3) {\n        applyImpulseNew(this, vector);\n    };\n\n    Player.prototype.clearVelocity = function () {\n        clearVelocity(this);\n    };\n}\n","/* eslint-disable no-constant-condition */\nimport { system } from '@minecraft/server';\nimport { Logger } from '../Logging';\n\nconst log = Logger.getLogger('jobUtils', 'bedrock-boost', 'jobUtils');\n\n/**\n * Runs a job and returns a promise that resolves when the job is done.\n * @param generator The generator function to run.\n * @returns A promise that resolves when the job is done.\n * @example\n * ```ts\n * const dimension = world.getDimension(MinecraftDimensionTypes.overworld);\n * function* generator(startLocation: Vec3): Generator<void, Block | undefined, void> {\n *   for (let x = 0; x < 10; x++) {\n *     for (let z = 0; z < 10; z++) {\n *       for (let y = 0; y < 10; y++) {\n *         const location = startLocation.add(x, y, z);\n *         const block = dimension.getBlock(location);\n *         if (block && block.isSolid) {\n *           return block;\n *         }\n *         yield;\n *       }\n *     }\n *   }\n * }\n * jobPromise(generator(Vec3.from(0, 0, 0)))\n *   .then(console.log);\n * ```\n */\nexport function jobPromise<Result>(\n    generator: Generator<void, Result, void>\n): Promise<Result> {\n    return new Promise((resolve, reject) => {\n        if (system.runJob) {\n            system.runJob(\n                (function* () {\n                    while (true) {\n                        try {\n                            const { done: d, value } = generator.next();\n                            if (d) {\n                                resolve(value as Result);\n                                return;\n                            } else {\n                                yield;\n                            }\n                        } catch (err) {\n                            reject(err);\n                            return;\n                        }\n                    }\n                })()\n            );\n        } else {\n            log.debug(\n                'system.runJob is not available. Running job in an inefficient way.'\n            );\n            const run = () => {\n                const startTime = Date.now();\n                while (true) {\n                    try {\n                        const { done: d, value } = generator.next();\n                        if (d) {\n                            resolve(value as Result);\n                            return;\n                        } else {\n                            if (Date.now() - startTime > 4) {\n                                system.runTimeout(run, 1);\n                                return;\n                            }\n                        }\n                    } catch (err) {\n                        reject(err);\n                        return;\n                    }\n                }\n            };\n            run();\n        }\n    });\n}\n\n/**\n * Runs a job and returns a promise that resolves when the job is done. The promise also reports progress once per tick.\n * @param generator The generator function to run.\n * @param onProgress The function to call when progress is reported.\n * @returns A promise that resolves when the job is done.\n * @example\n * ```ts\n * const dimension = world.getDimension(MinecraftDimensionTypes.overworld);\n * function* generator(startLocation: Vec3): Generator<number, Block | undefined, void> {\n *   const total = 10 * 10 * 10;\n *   for (let x = 0; x < 10; x++) {\n *     for (let z = 0; z < 10; z++) {\n *       for (let y = 0; y < 10; y++) {\n *         const location = startLocation.add(x, y, z);\n *         const block = dimension.getBlock(location);\n *         if (block && block.isSolid) {\n *           return block;\n *         }\n *         yield (x * 10 * 10 + z * 10 + y) / total;\n *       }\n *     }\n *   }\n * }\n * jobProgressPromise(generator(Vec3.from(0, 0, 0)), console.log)\n *   .then(console.log);\n * ```\n */\nexport function jobProgressPromise<Progress, Result>(\n    generator: Generator<Progress, Result, void>,\n    onProgress: (progress: Progress) => void\n): Promise<Result> {\n    return new Promise((resolve, reject) => {\n        if (system.runJob) {\n            system.runJob(\n                (function* () {\n                    let lastTick = 0;\n                    while (true) {\n                        try {\n                            const { done: d, value } = generator.next();\n                            if (d) {\n                                resolve(value as Result);\n                                return;\n                            } else {\n                                // Limit progress updates to once per tick.\n                                if (system.currentTick !== lastTick) {\n                                    onProgress(value as Progress);\n                                    lastTick = system.currentTick;\n                                }\n                                yield;\n                            }\n                        } catch (err) {\n                            reject(err);\n                            return;\n                        }\n                    }\n                })()\n            );\n        } else {\n            log.debug(\n                'system.runJob is not available. Running job in an inefficient way.'\n            );\n            const run = () => {\n                const startTime = Date.now();\n                let sentProgress = false;\n                while (true) {\n                    try {\n                        const { done: d, value } = generator.next();\n                        if (d) {\n                            resolve(value as Result);\n                            return;\n                        } else {\n                            // Limit progress updates to once per tick.\n                            if (!sentProgress) {\n                                onProgress(value as Progress);\n                                sentProgress = true;\n                            }\n                            if (Date.now() - startTime > 4) {\n                                system.runTimeout(run, 1);\n                                return;\n                            }\n                        }\n                    } catch (err) {\n                        reject(err);\n                        return;\n                    }\n                }\n            };\n            run();\n        }\n    });\n}\n","import { Dimension, Vector3 } from '@minecraft/server';\nimport { getDimensionHeightRange } from '../Cache';\n\n/**\n * Checks if a location is between the min and max height of a dimension.\n * @param dimension The dimension to check.\n * @param location The location to check.\n * @returns True if the location is valid, otherwise false.\n */\nexport function isValidLocation(\n    dimension: Dimension | string,\n    location: Vector3\n): boolean {\n    if (typeof dimension !== 'string') {\n        dimension = dimension.id;\n    }\n    const range = getDimensionHeightRange(dimension);\n    return location.y >= range.min && location.y <= range.max;\n}\n","import { system } from '@minecraft/server';\nimport { Logger } from '../Logging';\n\n/**\n * Represents a scheduler that executes a processor function at regular intervals for each item in the list.\n * @template T The type of items in the scheduler.\n */\nexport default class PulseScheduler<T> {\n    private static readonly log: Logger = Logger.getLogger(\n        'PulseScheduler',\n        'bedrock-boost',\n        'pulse-scheduler'\n    );\n    protected items: T[] = [];\n    private period: number;\n    private currentTick: number = 0;\n    private runId?: number;\n    private nextIndex: number = 0;\n    private executionSchedule: number[] = [];\n    processor: (t: T) => void;\n\n    /**\n     * Creates a new PulseScheduler instance.\n     * @param period The period of the scheduler.\n     */\n    constructor(processor: (t: T) => void, period: number) {\n        if (period <= 0) {\n            throw new Error('Period must be a positive integer.');\n        }\n        if (!processor || typeof processor !== 'function') {\n            throw new Error('Processor function must be defined.');\n        }\n        this.period = period;\n        this.processor = processor;\n    }\n\n    /**\n     * Removes an item from the schedule at the specified index.\n     * @param index - The index of the item to remove.\n     */\n    remove(index: number) {\n        if (index >= 0 && index < this.items.length) {\n            this.items.splice(index, 1);\n            // Adjust nextTaskIndex if necessary to maintain execution order\n            if (index < this.nextIndex) {\n                this.nextIndex--;\n            }\n            this.recalculateExecutionSchedule();\n        }\n    }\n\n    /**\n     * Removes items from the schedule that satisfy the given predicate.\n     *\n     * @param predicate - The predicate function used to determine if an item should be removed.\n     */\n    removeIf(predicate: (t: T) => boolean) {\n        for (let i = this.items.length - 1; i >= 0; i--) {\n            if (predicate(this.items[i])) {\n                this.remove(i);\n            }\n        }\n    }\n\n    /**\n     * Returns a list of the items in the schedule.\n     */\n    getItems(): ReadonlyArray<T> {\n        return this.items;\n    }\n\n    /**\n     * Starts the schedule.\n     */\n    start() {\n        this.stop();\n        this.currentTick = 0;\n        this.nextIndex = 0;\n        this.runId = system.runInterval(() => this.tick(), 1);\n    }\n\n    /**\n     * Stops the schedule.\n     */\n    stop() {\n        if (this.runId !== undefined) {\n            system.clearRun(this.runId);\n            this.runId = undefined;\n        }\n    }\n\n    private recalculateExecutionSchedule() {\n        // Calculate the number of executions per tick\n        const totalExecutions = this.items.length;\n        this.executionSchedule = new Array(this.period).fill(0);\n        if (totalExecutions === 0) {\n            return;\n        }\n        const interval = this.period / totalExecutions;\n        for (let i = 0; i < totalExecutions; i++) {\n            this.executionSchedule[Math.round(interval * i) % this.period]++;\n        }\n    }\n\n    private tick() {\n        if (this.items.length === 0) {\n            PulseScheduler.log.trace('No items to process.');\n            return;\n        }\n        // Number of items to process this tick\n        const scheduledExecutions = this.executionSchedule[this.currentTick];\n        if (scheduledExecutions === 0) {\n            PulseScheduler.log.trace('No items to process this tick.');\n            // Increment the tick counter\n            this.currentTick = (this.currentTick + 1) % this.period;\n            // Reset the index if we're at the end of the period\n            if (this.currentTick === 0) {\n                this.nextIndex = 0;\n            }\n            return;\n        }\n        // Execution counter for this tick\n        let executed = 0;\n\n        // Process items according to the schedule\n        // If we reach the end of the list without having correct number of executions, stop.\n        // It's most likely caused by an item being removed.\n        for (\n            ;\n            this.nextIndex < this.items.length &&\n            executed < scheduledExecutions;\n            this.nextIndex++\n        ) {\n            try {\n                this.processor(this.items[this.nextIndex]);\n            } catch (e) {\n                PulseScheduler.log.error('Error processing item', e);\n            }\n            executed++;\n        }\n\n        // Increment the tick counter\n        this.currentTick = (this.currentTick + 1) % this.period;\n\n        // Reset the index if we're at the end of the period\n        if (this.currentTick === 0) {\n            this.nextIndex = 0;\n        }\n    }\n\n    push(...items: T[]): number {\n        this.items.push(...items);\n        this.recalculateExecutionSchedule();\n        return this.items.length;\n    }\n\n    pop(): T | undefined {\n        const item = this.items.pop();\n        this.recalculateExecutionSchedule();\n        return item;\n    }\n\n    shift(): T | undefined {\n        const item = this.items.shift();\n        this.recalculateExecutionSchedule();\n        return item;\n    }\n\n    unshift(...items: T[]): number {\n        this.items.unshift(...items);\n        this.recalculateExecutionSchedule();\n        return this.items.length;\n    }\n\n    splice(start: number, deleteCount?: number): T[];\n    splice(start: number, deleteCount: number, ...items: T[]): T[];\n    splice(start: number, deleteCount: number = 0, ...items: T[]): T[] {\n        const removed = this.items.splice(start, deleteCount, ...items);\n        this.recalculateExecutionSchedule();\n        return removed;\n    }\n}\n","import PulseScheduler from './PulseScheduler';\n\n/**\n * Represents a scheduler for executing tasks.\n */\nexport default class TaskPulseScheduler extends PulseScheduler<() => void> {\n    /**\n     * Creates a new TaskSchedule instance.\n     * @param period The period of the schedule.\n     */\n    constructor(period: number) {\n        super((task) => task(), period);\n    }\n}\n","import PulseScheduler from './PulseScheduler';\n\n/**\n * Represents a PulseScheduler that only adds unique items to the schedule.\n */\nexport default class UniquePulseScheduler<T> extends PulseScheduler<T> {\n    /**\n     * Creates a new UniquePulseScheduler instance.\n     * @param period The period of the scheduler.\n     */\n    constructor(\n        processor: (t: T) => void,\n        period: number,\n        private equalityFunction: (a: T, b: T) => boolean = (a, b) => a === b\n    ) {\n        super(processor, period);\n    }\n\n    push(...items: T[]): number {\n        const filtered = items.filter(\n            (item) =>\n                !this.items.some((existingItem) =>\n                    this.equalityFunction(existingItem, item)\n                )\n        );\n        return super.push(...filtered);\n    }\n\n    unshift(...items: T[]): number {\n        const filtered = items.filter(\n            (item) =>\n                !this.items.some((existingItem) =>\n                    this.equalityFunction(existingItem, item)\n                )\n        );\n        return super.unshift(...filtered);\n    }\n\n    splice(start: number, deleteCount?: number | undefined): T[];\n    splice(start: number, deleteCount: number, ...items: T[]): T[];\n    splice(start: number, deleteCount?: number, ...items: T[]): T[] {\n        if (deleteCount === void 0) {\n            return super.splice(start);\n        }\n        const filtered = items.filter(\n            (item) =>\n                !this.items.some((existingItem) =>\n                    this.equalityFunction(existingItem, item)\n                )\n        );\n        return super.splice(start, deleteCount, ...filtered);\n    }\n}\n","import { Entity, EntityQueryOptions, system, world } from '@minecraft/server';\nimport PulseScheduler from './PulseScheduler';\nimport { Logger } from '../Logging';\n\n/**\n * Represents a PulseScheduler that processes entities matching a query.\n */\nexport default class EntityPulseScheduler extends PulseScheduler<Entity> {\n    private static readonly logger = Logger.getLogger(\n        'EntityPulseScheduler',\n        'bedrock-boost',\n        'entity-pulse-scheduler'\n    );\n    private readonly filteredScratch: Entity[] = [];\n    /**\n     * Creates a new EntityPulseScheduler instance.\n     * @param period The period of the scheduler.\n     * @param queryOptions The query options to use when querying for entities.\n     */\n    constructor(\n        processor: (t: Entity) => void,\n        period: number,\n        private queryOptions: EntityQueryOptions\n    ) {\n        super((t: Entity) => {\n            if (t.isValid) {\n                processor(t);\n            } else {\n                this.removeIf((entity) => !entity.isValid);\n            }\n        }, period);\n        this.push(\n            ...world\n                .getDimension('minecraft:overworld')\n                .getEntities(this.queryOptions)\n        );\n        this.push(\n            ...world\n                .getDimension('minecraft:nether')\n                .getEntities(this.queryOptions)\n        );\n        this.push(\n            ...world\n                .getDimension('minecraft:the_end')\n                .getEntities(this.queryOptions)\n        );\n    }\n\n    private compareEntities(a: Entity, b: Entity): boolean {\n        return a.id === b.id;\n    }\n\n    start(): void {\n        world.afterEvents.entityLoad.subscribe((event) => {\n            this.addIfMatchesWithRetry(event.entity);\n        });\n        world.afterEvents.entitySpawn.subscribe((event) => {\n            this.addIfMatchesWithRetry(event.entity);\n        });\n        world.afterEvents.entityRemove.subscribe((event) => {\n            this.removeIf(\n                (entity) =>\n                    !entity.isValid || entity.id === event.removedEntityId\n            );\n        });\n        super.start();\n    }\n\n    /**\n     * Adds an entity to the scheduler if it matches the query options. In case the entity is not valid, it will retry a tick later.\n     * @param entity The entity to add.\n     */\n    private addIfMatchesWithRetry(entity: Entity): void {\n        try {\n            if (!entity) {\n                return;\n            }\n            // Special case for when the entity is loaded from a structure and removed the same tick\n            if (!entity.isValid) {\n                const runId = system.runInterval(() => {\n                    if (entity.isValid && entity.matches(this.queryOptions)) {\n                        system.clearRun(runId);\n                        this.push(entity);\n                    }\n                }, 1);\n            } else if (entity.matches(this.queryOptions)) {\n                this.push(entity);\n            }\n        } catch (e) {\n            //TODO: Maybe it should be scheduled for reprocessing?\n            EntityPulseScheduler.logger.debug(\n                'Failed to push entity to scheduler.',\n                e\n            );\n        }\n    }\n\n    push(...items: Entity[]): number {\n        const filtered = this.filteredScratch;\n        filtered.length = 0;\n        for (const item of items) {\n            if (!item.isValid) {\n                continue;\n            }\n            let duplicate = false;\n            for (const existingItem of this.items) {\n                if (this.compareEntities(existingItem, item)) {\n                    duplicate = true;\n                    break;\n                }\n            }\n            if (!duplicate) {\n                filtered.push(item);\n            }\n        }\n        const result = super.push(...filtered);\n        filtered.length = 0;\n        return result;\n    }\n\n    unshift(...items: Entity[]): number {\n        const filtered = this.filteredScratch;\n        filtered.length = 0;\n        for (const item of items) {\n            if (!item.isValid) {\n                continue;\n            }\n            let duplicate = false;\n            for (const existingItem of this.items) {\n                if (this.compareEntities(existingItem, item)) {\n                    duplicate = true;\n                    break;\n                }\n            }\n            if (!duplicate) {\n                filtered.push(item);\n            }\n        }\n        const result = super.unshift(...filtered);\n        filtered.length = 0;\n        return result;\n    }\n\n    splice(start: number, deleteCount?: number | undefined): Entity[];\n    splice(start: number, deleteCount: number, ...items: Entity[]): Entity[];\n    splice(start: number, deleteCount?: number, ...items: Entity[]): Entity[] {\n        if (deleteCount === void 0) {\n            return super.splice(start);\n        }\n        const filtered = this.filteredScratch;\n        filtered.length = 0;\n        for (const item of items) {\n            let duplicate = false;\n            for (const existingItem of this.items) {\n                if (this.compareEntities(existingItem, item)) {\n                    duplicate = true;\n                    break;\n                }\n            }\n            if (!duplicate) {\n                filtered.push(item);\n            }\n        }\n        const result = super.splice(start, deleteCount, ...filtered);\n        filtered.length = 0;\n        return result;\n    }\n}\n","import { Player, system, world } from '@minecraft/server';\nimport PulseScheduler from './PulseScheduler';\nimport { Logger } from '../Logging';\n\n/**\n * Represents a PulseScheduler that processes players.\n */\nexport default class PlayerPulseScheduler extends PulseScheduler<Player> {\n    private static readonly logger = Logger.getLogger(\n        'PlayerPulseScheduler',\n        'bedrock-boost',\n        'player-pulse-scheduler'\n    );\n\n    /**\n     * Creates a new PlayerPulseScheduler instance.\n     * @param period The period of the scheduler.\n     */\n    constructor(processor: (t: Player) => void, period: number) {\n        super((t: Player) => {\n            if (t.isValid) {\n                processor(t);\n            } else {\n                this.removeIf((entity) => !entity.isValid);\n            }\n        }, period);\n        try {\n            this.push(...world.getAllPlayers());\n        } catch (e) {\n            system.runTimeout(() => {\n                this.push(...world.getAllPlayers());\n            }, 1);\n        }\n    }\n\n    private compareEntities(a: Player, b: Player): boolean {\n        return a.id === b.id;\n    }\n\n    start(): void {\n        world.afterEvents.playerJoin.subscribe((event) => {\n            let attempts = 0;\n            const pushPlayer = () => {\n                attempts++;\n                if (attempts > 10) {\n                    PlayerPulseScheduler.logger.debug(\n                        'Failed to push player to scheduler after 10 attempts.'\n                    );\n                    return;\n                }\n                try {\n                    const player = world.getEntity(event.playerId);\n                    if (player === void 0) {\n                        system.runTimeout(pushPlayer, 1);\n                    }\n                    if (player instanceof Player) {\n                        this.push(player);\n                    }\n                } catch (e) {\n                    PlayerPulseScheduler.logger.debug(\n                        'Failed to push player to scheduler.',\n                        e\n                    );\n                    system.runTimeout(pushPlayer, 1);\n                }\n            };\n            pushPlayer();\n        });\n        world.afterEvents.playerLeave.subscribe((event) => {\n            this.removeIf(\n                (entity) => !entity.isValid || entity.id === event.playerId\n            );\n        });\n        super.start();\n    }\n\n    push(...items: Player[]): number {\n        const filtered = items.filter(\n            (item) =>\n                item.isValid &&\n                !this.items.some((existingItem) =>\n                    this.compareEntities(existingItem, item)\n                )\n        );\n        return super.push(...filtered);\n    }\n\n    unshift(...items: Player[]): number {\n        const filtered = items.filter(\n            (item) =>\n                item.isValid &&\n                !this.items.some((existingItem) =>\n                    this.compareEntities(existingItem, item)\n                )\n        );\n        return super.unshift(...filtered);\n    }\n\n    splice(start: number, deleteCount?: number | undefined): Player[];\n    splice(start: number, deleteCount: number, ...items: Player[]): Player[];\n    splice(start: number, deleteCount?: number, ...items: Player[]): Player[] {\n        if (deleteCount === void 0) {\n            return super.splice(start);\n        }\n        const filtered = items.filter(\n            (item) =>\n                !this.items.some((existingItem) =>\n                    this.compareEntities(existingItem, item)\n                )\n        );\n        return super.splice(start, deleteCount, ...filtered);\n    }\n}\n","import { Dimension, Entity, Player, Vector3 } from '@minecraft/server';\n\nexport enum InputPermission {\n    Movement = 'movement',\n    Camera = 'camera',\n}\nexport enum CameraShakeType {\n    Positional = 'positional',\n    Rotational = 'rotational',\n}\nexport enum SlotLocation {\n    Armor = 'slot.armor',\n    Body = 'slot.armor.body',\n    ArmorChest = 'slot.armor.chest',\n    Feet = 'slot.armor.feet',\n    Head = 'slot.armor.head',\n    Legs = 'slot.armor.legs',\n    Chest = 'slot.chest',\n    EnderChest = 'slot.enderchest',\n    Equippable = 'slot.equippable',\n    Hotbar = 'slot.hotbar',\n    Inventory = 'slot.inventory',\n    Saddle = 'slot.saddle',\n    MainHand = 'slot.weapon.mainhand',\n    OffHand = 'slot.weapon.offhand',\n}\n\nexport type Quantity =\n    | number\n    | {\n          min?: number;\n          max: number;\n      }\n    | {\n          min: number;\n          max?: number;\n      };\n\nexport type ItemMatcher = {\n    // these properties are always allowed\n    item?: string;\n    quantity?: Quantity;\n    data?: number;\n    slotLocation?: SlotLocation;\n    slot?: number;\n} & ( // if slot is specified, slotLocation must also be defined\n    | { slot?: undefined; slotLocation?: SlotLocation }\n    | { slot: number; slotLocation: SlotLocation }\n);\n\n/**\n * This is a collection of utility methods for working with commands until a proper API is available.\n * Once a proper API is available and stable, I'll change function to use that instead and mark it as deprecated.\n */\nexport class CommandUtils {\n    /**\n     * Adds camera shake effect to the specified player.\n     * @param player - The player to apply the camera shake effect to.\n     * @param type - The type of camera shake effect.\n     * @param intensity - The intensity of the camera shake effect.\n     * @param duration - The duration of the camera shake effect in seconds.\n     */\n    public static addCameraShake(\n        player: Player,\n        type: CameraShakeType,\n        intensity: number,\n        duration: number\n    ): void {\n        player.runCommand(\n            `camerashake add @s ${intensity.toFixed(20)} ${duration.toFixed(\n                20\n            )} ${type}`\n        );\n    }\n    /**\n     * Stops the camera shake for the specified player.\n     * @param player The player for whom to stop the camera shake.\n     */\n    public static stopCameraShake(player: Player): void {\n        player.runCommand(`camerashake stop @s`);\n    }\n    /**\n     * Destroys the block as if it's broken by a player.\n     * @param dimension The dimension in which to destroy the block.\n     * @param location The location of the block to destroy.\n     */\n    public static destroyBlock(dimension: Dimension, location: Vector3): void {\n        dimension.runCommand(\n            `setblock ${location.x} ${location.y} ${location.z} air destroy`\n        );\n    }\n    /**\n     * Checks if an entity have items matching the specified matchers.\n     * @param entity The entity to check.\n     * @param matchers The matchers to check.\n     * @returns True if the entity has items matching the matchers, false otherwise.\n     *\n     * @remarks\n     * This method uses the `testfor` command and `hasitem` selector, so that you can check for the data of the item.\n     */\n    public static isItem(entity: Entity, matchers: ItemMatcher[]): boolean {\n        let cmd = `testfor @s[hasitem=[`;\n        for (let i = 0; i < matchers.length; i++) {\n            const matcher = matchers[i];\n            cmd += `{item=${matcher.item}`;\n            if (matcher.quantity !== void 0) {\n                cmd += ',quantity=';\n                if (typeof matcher.quantity === 'number') {\n                    cmd += matcher.quantity;\n                } else {\n                    if (matcher.quantity.min !== void 0) {\n                        cmd += matcher.quantity.min;\n                    }\n                    cmd += '..';\n                    if (matcher.quantity.max !== void 0) {\n                        cmd += matcher.quantity.max;\n                    }\n                }\n            }\n            if (matcher.data !== void 0) {\n                cmd += `,data=${matcher.data}`;\n            }\n            if (matcher.slotLocation !== void 0) {\n                cmd += `,location=${matcher.slotLocation}`;\n                if (matcher.slot !== void 0) {\n                    cmd += `,slot=${matcher.slot}`;\n                }\n            }\n            cmd += '}';\n        }\n        cmd += ']]';\n        const result = entity.runCommand(cmd);\n        return result.successCount > 0;\n    }\n\n    /**\n     * Pushes a fog to the top of the player's fog stack with the specified user provided ID.\n     * @param player The player to push the fog to.\n     * @param fogId The ID of the fog to push.\n     * @param userProvidedId The user-provided ID of the fog to push.\n     * @returns True if the fog was pushed successfully, false otherwise.\n     *\n     * @remarks\n     * This method uses the `fog` command and `push` subcommand.\n     */\n    public static pushFog(\n        player: Player,\n        fogId: string,\n        userProvidedId: string\n    ): boolean {\n        return (\n            player.runCommand(`fog @s push ${fogId} ${userProvidedId}`)\n                .successCount > 0\n        );\n    }\n\n    /**\n     * Pops a fog from the top of the player's fog stack matching the specified user provided ID.\n     * @param player The player to pop the fog from.\n     * @param fogId The ID of the fog to pop.\n     * @param userProvidedId The user-provided ID of the fog to pop.\n     * @returns True if the fog was popped successfully, false otherwise.\n     *\n     * @remarks\n     * This method uses the `fog` command and `pop` subcommand.\n     */\n    public static popFog(\n        player: Player,\n        fogId: string,\n        userProvidedId: string\n    ): boolean {\n        return (\n            player.runCommand(`fog @s pop ${fogId} ${userProvidedId}`)\n                .successCount > 0\n        );\n    }\n\n    /**\n     * Removes all fogs from the player's fog stack matching the specified user provided ID.\n     * @param player The player to remove the fog from.\n     * @param fogId The ID of the fog to remove.\n     * @param userProvidedId The user-provided ID of the fog to remove.\n     * @returns True if the fog was removed successfully, false otherwise.\n     *\n     * @remarks\n     * This method uses the `fog` command and `remove` subcommand.\n     */\n    public static removeFog(\n        player: Player,\n        fogId: string,\n        userProvidedId: string\n    ): boolean {\n        return (\n            player.runCommand(`fog @s remove ${fogId} ${userProvidedId}`)\n                .successCount > 0\n        );\n    }\n}\n","import { Entity, Player, system } from '@minecraft/server';\n\n/**\n * Represents a Molang expression. This will be injected into the variable value as Molang expression.\n */\nexport type MolangExpression = {\n    /**\n     * The Molang expression to inject.\n     */\n    value: string;\n};\n\n/**\n * Represents a Molang value. This can be a number, boolean, or Molang expression.\n */\nexport type MolangValue = number | boolean | MolangExpression;\n\n/**\n * Sends Molang variables to an entity using `playanimation` command.\n * @param entity The entity to send the data to.\n * @param animation The RP animation to send the data through.\n * @param data The data to send.\n * @param receivers Players to send the data to. If not specified, the data will be sent to all players.\n */\nexport function sendMolangData(\n    entity: Entity,\n    animation: string,\n    data: { [key: string]: MolangValue },\n    receivers: Player[] = []\n) {\n    data['v.__time__'] = system.currentTick;\n    data['v.__random__'] = (Math.random() * 1000) << 0;\n    const stopExpression =\n        Object.entries(data)\n            .map(([key, value]) => {\n                if (typeof value === 'number') {\n                    return `${key}=${value}`;\n                } else if (typeof value === 'boolean') {\n                    return `${key}=${value ? 1 : 0}`;\n                } else {\n                    return `${key}=${value.value}`;\n                }\n            })\n            .join(';') + ';return 0;';\n    entity.playAnimation(animation, {\n        stopExpression: stopExpression,\n        controller: '__' + animation + '_send_data__',\n        players: receivers,\n    });\n}\n","export default class VanillaBlockTags {\n    public static readonly Acacia = 'acacia';\n    public static readonly Birch = 'birch';\n    public static readonly Crop = 'minecraft:crop';\n    public static readonly DarkOak = 'dark_oak';\n    public static readonly DiamondPickDiggable = 'diamond_pick_diggable';\n    public static readonly DiamondTierDestructible =\n        'minecraft:diamond_tier_destructible';\n    public static readonly Dirt = 'dirt';\n    public static readonly FertilizeArea = 'fertilize_area';\n    public static readonly GoldPickDiggable = 'gold_pick_diggable';\n    public static readonly Grass = 'grass';\n    public static readonly Gravel = 'gravel';\n    public static readonly IronPickDiggable = 'iron_pick_diggable';\n    public static readonly IronTierDestructible =\n        'minecraft:iron_tier_destructible';\n    public static readonly IsAxeItemDestructible =\n        'minecraft:is_axe_item_destructible';\n    public static readonly IsHoeItemDestructible =\n        'minecraft:is_hoe_item_destructible';\n    public static readonly IsMaceItemDestructible =\n        'minecraft:is_mace_item_destructible';\n    public static readonly IsPickaxeItemDestructible =\n        'minecraft:is_pickaxe_item_destructible';\n    public static readonly IsShearsItemDestructible =\n        'minecraft:is_shears_item_destructible';\n    public static readonly IsShovelItemDestructible =\n        'minecraft:is_shovel_item_destructible';\n    public static readonly IsSwordItemDestructible =\n        'minecraft:is_sword_item_destructible';\n    public static readonly Jungle = 'jungle';\n    public static readonly Log = 'log';\n    public static readonly Metal = 'metal';\n    public static readonly MobSpawner = 'mob_spawner';\n    public static readonly NetheriteTierDestructible =\n        'minecraft:netherite_tier_destructible';\n    public static readonly NotFeatureReplaceable = 'not_feature_replaceable';\n    public static readonly Oak = 'oak';\n    public static readonly OneWayCollidable = 'one_way_collidable';\n    public static readonly Plant = 'plant';\n    public static readonly Pumpkin = 'pumpkin';\n    public static readonly Rail = 'rail';\n    public static readonly Sand = 'sand';\n    public static readonly Snow = 'snow';\n    public static readonly Spruce = 'spruce';\n    public static readonly Stone = 'stone';\n    public static readonly StonePickDiggable = 'stone_pick_diggable';\n    public static readonly StoneTierDestructible =\n        'minecraft:stone_tier_destructible';\n    public static readonly TextSign = 'text_sign';\n    public static readonly Trapdoors = 'trapdoors';\n    public static readonly Water = 'water';\n    public static readonly Wood = 'wood';\n    public static readonly WoodPickDiggable = 'wood_pick_diggable';\n}\n","export default class VanillaItemTags {\n    public static readonly Arrow = 'minecraft:arrow';\n    public static readonly Banner = 'minecraft:banner';\n    public static readonly Boat = 'minecraft:boat';\n    public static readonly Boats = 'minecraft:boats';\n    public static readonly BookshelfBooks = 'minecraft:bookshelf_books';\n    public static readonly ChainmailTier = 'minecraft:chainmail_tier';\n    public static readonly ChestBoat = 'minecraft:chest_boat';\n    public static readonly Coals = 'minecraft:coals';\n    public static readonly CopperTier = 'minecraft:copper_tier';\n    public static readonly CrimsonStems = 'minecraft:crimson_stems';\n    public static readonly DecoratedPotSherds =\n        'minecraft:decorated_pot_sherds';\n    public static readonly DiamondTier = 'minecraft:diamond_tier';\n    public static readonly Digger = 'minecraft:digger';\n    public static readonly Door = 'minecraft:door';\n    public static readonly Egg = 'minecraft:egg';\n    public static readonly GoldenTier = 'minecraft:golden_tier';\n    public static readonly HangingActor = 'minecraft:hanging_actor';\n    public static readonly HangingSign = 'minecraft:hanging_sign';\n    public static readonly Harness = 'minecraft:harness';\n    public static readonly HorseArmor = 'minecraft:horse_armor';\n    public static readonly IronTier = 'minecraft:iron_tier';\n    public static readonly IsArmor = 'minecraft:is_armor';\n    public static readonly IsAxe = 'minecraft:is_axe';\n    public static readonly IsCooked = 'minecraft:is_cooked';\n    public static readonly IsFish = 'minecraft:is_fish';\n    public static readonly IsFood = 'minecraft:is_food';\n    public static readonly IsHoe = 'minecraft:is_hoe';\n    public static readonly IsMeat = 'minecraft:is_meat';\n    public static readonly IsMinecart = 'minecraft:is_minecart';\n    public static readonly IsPickaxe = 'minecraft:is_pickaxe';\n    public static readonly IsShears = 'minecraft:is_shears';\n    public static readonly IsShovel = 'minecraft:is_shovel';\n    public static readonly IsSword = 'minecraft:is_sword';\n    public static readonly IsTool = 'minecraft:is_tool';\n    public static readonly IsTrident = 'minecraft:is_trident';\n    public static readonly LeatherTier = 'minecraft:leather_tier';\n    public static readonly LecternBooks = 'minecraft:lectern_books';\n    public static readonly Logs = 'minecraft:logs';\n    public static readonly LogsThatBurn = 'minecraft:logs_that_burn';\n    public static readonly MangroveLogs = 'minecraft:mangrove_logs';\n    public static readonly MusicDisc = 'minecraft:music_disc';\n    public static readonly NetheriteTier = 'minecraft:netherite_tier';\n    public static readonly PiglinLoved = 'minecraft:piglin_loved';\n    public static readonly PiglinRepellents = 'minecraft:piglin_repellents';\n    public static readonly Planks = 'minecraft:planks';\n    public static readonly Sand = 'minecraft:sand';\n    public static readonly Sign = 'minecraft:sign';\n    public static readonly SoulFireBaseBlocks =\n        'minecraft:soul_fire_base_blocks';\n    public static readonly SpawnEgg = 'minecraft:spawn_egg';\n    public static readonly StoneBricks = 'minecraft:stone_bricks';\n    public static readonly StoneCraftingMaterials =\n        'minecraft:stone_crafting_materials';\n    public static readonly StoneTier = 'minecraft:stone_tier';\n    public static readonly StoneToolMaterials =\n        'minecraft:stone_tool_materials';\n    public static readonly TransformableItems = 'minecraft:transformable_items';\n    public static readonly TransformMaterials = 'minecraft:transform_materials';\n    public static readonly TransformTemplates = 'minecraft:transform_templates';\n    public static readonly TrimmableArmors = 'minecraft:trimmable_armors';\n    public static readonly TrimMaterials = 'minecraft:trim_materials';\n    public static readonly TrimTemplates = 'minecraft:trim_templates';\n    public static readonly VibrationDamper = 'minecraft:vibration_damper';\n    public static readonly WarpedStems = 'minecraft:warped_stems';\n    public static readonly WoodenSlabs = 'minecraft:wooden_slabs';\n    public static readonly WoodenTier = 'minecraft:wooden_tier';\n    public static readonly Wool = 'minecraft:wool';\n}\n","export default class TimeOfDay {\n    public static readonly Day = 1000;\n    public static readonly Midnight = 18000;\n    public static readonly Night = 13000;\n    public static readonly Noon = 6000;\n    public static readonly Sunrise = 23000;\n    public static readonly Sunset = 12000;\n}\n","import { Direction } from '@minecraft/server';\r\n\r\nexport default class DirectionUtils {\r\n    /**\r\n     * The opposite directions of the given directions.\r\n     */\r\n    public static readonly Opposites: Record<Direction, Direction> = {\r\n        [Direction.Down]: Direction.Up,\r\n        [Direction.Up]: Direction.Down,\r\n        [Direction.North]: Direction.South,\r\n        [Direction.South]: Direction.North,\r\n        [Direction.East]: Direction.West,\r\n        [Direction.West]: Direction.East,\r\n    };\r\n\r\n    /**\r\n     * The positive perpendicular directions of the given directions.\r\n     */\r\n    public static readonly PositivePerpendiculars: Record<\r\n        Direction,\r\n        Direction[]\r\n    > = {\r\n        [Direction.Down]: [Direction.East, Direction.North],\r\n        [Direction.Up]: [Direction.East, Direction.North],\r\n        [Direction.North]: [Direction.East, Direction.Up],\r\n        [Direction.South]: [Direction.East, Direction.Up],\r\n        [Direction.East]: [Direction.North, Direction.Up],\r\n        [Direction.West]: [Direction.North, Direction.Up],\r\n    };\r\n\r\n    /**\r\n     * The negative perpendicular directions of the given directions.\r\n     */\r\n    public static readonly NegativePerpendiculars: Record<\r\n        Direction,\r\n        Direction[]\r\n    > = {\r\n        [Direction.Down]: [Direction.West, Direction.South],\r\n        [Direction.Up]: [Direction.West, Direction.South],\r\n        [Direction.North]: [Direction.West, Direction.Down],\r\n        [Direction.South]: [Direction.West, Direction.Down],\r\n        [Direction.East]: [Direction.South, Direction.Down],\r\n        [Direction.West]: [Direction.South, Direction.Down],\r\n    };\r\n\r\n    /**\r\n     * The clockwise perpendicular directions of the given directions.\r\n     */\r\n    public static readonly ClockwisePerpendiculars: Record<\r\n        Direction,\r\n        Direction\r\n    > = {\r\n        [Direction.North]: Direction.East,\r\n        [Direction.East]: Direction.South,\r\n        [Direction.South]: Direction.West,\r\n        [Direction.West]: Direction.North,\r\n        // Not sure what should be here\r\n        [Direction.Up]: Direction.Down,\r\n        [Direction.Down]: Direction.Up,\r\n    };\r\n\r\n    /**\r\n     * The counter-clockwise perpendicular directions of the given directions.\r\n     */\r\n    public static readonly CounterClockwisePerpendiculars: Record<\r\n        Direction,\r\n        Direction\r\n    > = {\r\n        [Direction.North]: Direction.West,\r\n        [Direction.East]: Direction.North,\r\n        [Direction.South]: Direction.East,\r\n        [Direction.West]: Direction.South,\r\n        // Not sure what should be here\r\n        [Direction.Up]: Direction.Down,\r\n        [Direction.Down]: Direction.Up,\r\n    };\r\n\r\n    /**\r\n     * The same axis directions of the given directions.\r\n     */\r\n    public static readonly SameAxis: Record<Direction, Direction> = {\r\n        [Direction.North]: Direction.North,\r\n        [Direction.South]: Direction.North,\r\n        [Direction.East]: Direction.East,\r\n        [Direction.West]: Direction.East,\r\n        [Direction.Up]: Direction.Up,\r\n        [Direction.Down]: Direction.Up,\r\n    };\r\n\r\n    /**\r\n     * Directions by their string representation.\r\n     */\r\n    public static readonly FromString: Record<string, Direction> = {\r\n        north: Direction.North,\r\n        east: Direction.East,\r\n        south: Direction.South,\r\n        west: Direction.West,\r\n        up: Direction.Up,\r\n        down: Direction.Down,\r\n    };\r\n\r\n    /**\r\n     * Strings by their direction representation.\r\n     */\r\n    public static readonly ToString: Record<Direction, string> = {\r\n        [Direction.North]: 'north',\r\n        [Direction.East]: 'east',\r\n        [Direction.South]: 'south',\r\n        [Direction.West]: 'west',\r\n        [Direction.Up]: 'up',\r\n        [Direction.Down]: 'down',\r\n    };\r\n\r\n    /**\r\n     * All directions.\r\n     */\r\n    public static readonly Values: Direction[] = [\r\n        Direction.Down,\r\n        Direction.Up,\r\n        Direction.North,\r\n        Direction.South,\r\n        Direction.East,\r\n        Direction.West,\r\n    ];\r\n}\r\n","import { RGBA } from '@minecraft/server';\n\nexport default class ColorUtils {\n    /**\n     * Parse hex string to RGBA. Hex string can be in format AARRGGBB or RRGGBB. Can be prefixed with # or 0x. Can also be a number.\n     * @param hex color\n     * @returns RGBA color\n     */\n    public static toRGBA(hex: string): RGBA;\n    /**\n     * Parse color to RGBA. Number can be in format AARRGGBB or RRGGBB.\n     * @param hex color\n     * @returns RGBA color\n     */\n    public static toRGBA(hex: number): RGBA;\n    /**\n     * Parse red, green and blue to RGBA. All numbers must be between 0 and 255.\n     * @param r red\n     * @param g green\n     * @param b blue\n     * @returns RGBA color\n     */\n    public static toRGBA(r: number, g: number, b: number): RGBA;\n    /**\n     * Parse red, green, blue and alpha to RGBA. All numbers must be between 0 and 255.\n     * @param r red\n     * @param g green\n     * @param b blue\n     * @param a alpha\n     * @returns RGBA color\n     */\n    public static toRGBA(r: number, g: number, b: number, a: number): RGBA;\n    public static toRGBA(\n        hex: string | number,\n        g?: number,\n        b?: number,\n        a?: number\n    ): RGBA {\n        if (typeof hex === 'number') {\n            if (g !== void 0 && b !== void 0) {\n                return {\n                    red: hex / 255.0,\n                    green: g / 255.0,\n                    blue: b / 255.0,\n                    alpha: a === void 0 ? 1 : a / 255.0,\n                };\n            }\n            const hasAlpha = hex > 0xffffff;\n            return {\n                red: ((hex & 0xff0000) >> 16) / 255.0,\n                green: ((hex & 0xff00) >> 8) / 255.0,\n                blue: (hex & 0xff) / 255.0,\n                alpha: hasAlpha ? ((hex & 0xff000000) >>> 24) / 255.0 : 1,\n            };\n        }\n        if (hex.startsWith('#')) {\n            hex = hex.substring(1);\n        } else if (hex.startsWith('0x')) {\n            hex = hex.substring(2);\n        }\n        let alpha = 1;\n        if (hex.length === 8) {\n            alpha = parseInt(hex.substring(0, 2), 16) / 255.0;\n            hex = hex.substring(2);\n        }\n        return {\n            red: parseInt(hex.substring(0, 2), 16) / 255.0,\n            green: parseInt(hex.substring(2, 4), 16) / 255.0,\n            blue: parseInt(hex.substring(4, 6), 16) / 255.0,\n            alpha: alpha,\n        };\n    }\n}\n","import { Dimension, Entity, StructureSaveMode, world } from '@minecraft/server';\nimport Vec3 from '../math/Vec3';\nimport { getDimensionHeightRange } from '../Cache';\n\nexport default class EntitySaver {\n    /**\n     * Saves an entity to the structure.\n     * @param entity The entity to save.\n     * @param prefix The prefix to use for the structure.\n     * @param removeEntity Whether to remove the entity after saving.\n     * @returns The ID of the structure without the prefix.\n     */\n    public static save(\n        entity: Entity,\n        prefix: string,\n        removeEntity: boolean = true\n    ): number {\n        // Find a free ID\n        let id = (Math.random() * 1000000 + 1) << 0;\n        const structureManager = world.structureManager;\n        let i = 0;\n        while (structureManager.get(prefix + id)) {\n            id = (Math.random() * 1000000 + 1) << 0;\n            i++;\n            if (i > 1000) {\n                // Should NEVER happen\n                throw new Error('Failed to find a free ID');\n            }\n        }\n        const dimension = entity.dimension;\n        const originalLocation = Vec3.from(entity.location);\n        const location = originalLocation.setY(\n            getDimensionHeightRange(dimension.id).min\n        );\n        // Teleport the entity to the bottom of the world for saving\n        entity.teleport(location);\n        // Tag the entity for easier identification\n        entity.addTag(prefix + id);\n        // Create a structure with only entities\n        structureManager.createFromWorld(\n            prefix + id,\n            dimension,\n            location,\n            location,\n            {\n                includeBlocks: false,\n                includeEntities: true,\n                saveMode: StructureSaveMode.World,\n            }\n        );\n        if (removeEntity) {\n            // If the entity should be removed, remove it now\n            entity.remove();\n        } else {\n            // Otherwise, teleport the entity back to its original location\n            entity.teleport(originalLocation);\n        }\n        return id;\n    }\n    /**\n     * Loads an entity from the structure.\n     * @param id The ID of the structure without the prefix.\n     * @param prefix The prefix used for the structure.\n     * @param dimension The dimension to load the entity in.\n     * @param location The location to load the entity at.\n     * @param removeStructure Whether to remove the structure after loading.\n     * @returns The loaded entity, or undefined if the entity was not found.\n     */\n    public static load(\n        id: number,\n        prefix: string,\n        dimension: Dimension,\n        location: Vec3,\n        removeStructure: boolean = true\n    ): Entity | undefined {\n        const structureManager = world.structureManager;\n        // Find the structure\n        const structure = structureManager.get(prefix + id);\n        if (!structure) {\n            return undefined;\n        }\n        // Set place location at the bottom of the world\n        const placeLocation = location.setY(\n            getDimensionHeightRange(dimension.id).min\n        );\n        // Place the structure\n        structureManager.place(structure, dimension, placeLocation, {\n            includeBlocks: false,\n            includeEntities: true,\n        });\n        // Find the entity\n        const entities = dimension.getEntities({\n            location: placeLocation,\n            tags: [prefix + id],\n            closest: 1,\n        });\n        if (entities.length === 0) {\n            return undefined;\n        }\n        const entity = entities[0];\n        // Clean tag id\n        entity.removeTag(prefix + id);\n        // Teleport the entity back to its original location\n        entity.teleport(location);\n        if (removeStructure) {\n            // If the structure should be removed, remove it now\n            structureManager.delete(prefix + id);\n        }\n        return entity;\n    }\n    /**\n     * Removes all structures with the specified prefix.\n     * @param prefix The prefix to remove.\n     */\n    public static clean(prefix: string) {\n        const structureManager = world.structureManager;\n        structureManager\n            .getWorldStructureIds()\n            .filter((id) => id.startsWith(prefix))\n            .forEach((id) => {\n                structureManager.delete(id);\n            });\n    }\n    /**\n     * Deletes the structure with the specified ID.\n     * @param id The ID of the structure to delete.\n     * @param prefix The prefix used for the structure.\n     */\n    public static delete(id: number, prefix: string) {\n        const structureManager = world.structureManager;\n        structureManager.delete(prefix + id);\n    }\n}\n","import {\r\n    EntityEquippableComponent,\r\n    EquipmentSlot,\r\n    GameMode,\r\n    ItemDurabilityComponent,\r\n    ItemEnchantableComponent,\r\n    Player,\r\n} from '@minecraft/server';\r\nimport { Logger } from '../Logging';\r\n\r\nconst log = Logger.getLogger('itemUtils', 'bedrock-boost', 'itemUtils');\r\n\r\nexport interface ConsumeDurabilityOptions {\r\n    /**\r\n     * Whether to ignore enchantments when consuming durability.\r\n     */\r\n    ignoreEnchantments?: boolean;\r\n    /**\r\n     * Whether to ignore player's gamemode and consume durability anyways.\r\n     */\r\n    ignoreCreative?: boolean;\r\n    /**\r\n     * Whether to ignore unbreakable component when consuming durability. Defaults to false.\r\n     */\r\n    ignoreUnbreakable?: boolean;\r\n    /**\r\n     * The amount of durability to consume. Defaults to 1.\r\n     */\r\n    value?: number;\r\n    /**\r\n     * The slot to consume durability from. Defaults to the player's main hand.\r\n     */\r\n    slot?: EquipmentSlot;\r\n    /**\r\n     * Whether to suppress playing a sound when item breaks. Defaults to \"random.break\". If set to an empty string, no sound will be played.\r\n     */\r\n    breakSound?: string;\r\n}\r\n\r\nexport class ItemUtils {\r\n    /**\r\n     * Consumes durability from the player's selected item.\r\n     * @param player - The player whose item durability will be consumed.\r\n     * @param options - The options for consuming durability.\r\n     * @param options.ignoreEnchantments - Whether to ignore enchantments when consuming durability. Defaults to true.\r\n     * @param options.ignoreUnbreakable - Whether to ignore unbreakable component when consuming durability. Defaults to false.\r\n     * @param options.value - The amount of durability to consume. Defaults to 1.\r\n     * @param options.slot - The slot to consume durability from. Defaults to the player's selected slot.\r\n     * @param options.breakSound - Whether to suppress playing a sound when item breaks. Defaults to \"random.break\". If set to an empty string, no sound will be played.\r\n     * @returns True if the durability was consumed, false otherwise.\r\n     *\r\n     * @remarks\r\n     * Return value `false` does not always mean that the function failed. It can also mean that the item was not damaged due to unbreaking enchantment/unbreakable component.\r\n     */\r\n    public static consumeDurability(\r\n        player: Player,\r\n        options: ConsumeDurabilityOptions = {}\r\n    ): boolean {\r\n        if (\r\n            !options.ignoreCreative &&\r\n            player.getGameMode() === GameMode.Creative\r\n        ) {\r\n            return false;\r\n        }\r\n        if (options.value === void 0) {\r\n            options.value = 1;\r\n        }\r\n        if (options.slot === void 0) {\r\n            options.slot = EquipmentSlot.Mainhand;\r\n        }\r\n        if (options.breakSound === void 0) {\r\n            options.breakSound = 'random.break';\r\n        }\r\n        if (options.value < 1 || !player) {\r\n            log.error('Invalid value or player');\r\n            return false;\r\n        }\r\n        const equippable = player.getComponent(\r\n            EntityEquippableComponent.componentId\r\n        ) as EntityEquippableComponent;\r\n        if (!equippable) {\r\n            log.error('Player equippable component not found');\r\n            return false;\r\n        }\r\n        const item = equippable.getEquipment(options.slot);\r\n        if (!item) {\r\n            log.debug('No item in selected slot');\r\n            return false;\r\n        }\r\n        const durabilityComponent = item.getComponent(\r\n            ItemDurabilityComponent.componentId\r\n        ) as ItemDurabilityComponent;\r\n        if (!durabilityComponent) {\r\n            log.error('Item has no durability component');\r\n            return false;\r\n        }\r\n        if (!options.ignoreUnbreakable && durabilityComponent.unbreakable) {\r\n            return false;\r\n        }\r\n        if (!options.ignoreEnchantments) {\r\n            const enchantable = item.getComponent(\r\n                ItemEnchantableComponent.componentId\r\n            ) as ItemEnchantableComponent;\r\n            if (enchantable) {\r\n                const unbreakingLevel =\r\n                    enchantable.getEnchantment('unbreaking')?.level ?? 0;\r\n                if (\r\n                    ItemUtils.getUnbreakingChance(unbreakingLevel) <\r\n                    Math.random()\r\n                ) {\r\n                    return false;\r\n                }\r\n            }\r\n        }\r\n        if (\r\n            durabilityComponent.damage + options.value >=\r\n            durabilityComponent.maxDurability\r\n        ) {\r\n            log.trace('Item is broken');\r\n            equippable.setEquipment(options.slot, undefined);\r\n            if (options.breakSound.length > 0) {\r\n                player.playSound(options.breakSound);\r\n            }\r\n            return true;\r\n        }\r\n        durabilityComponent.damage = durabilityComponent.damage + options.value;\r\n        log.trace(\r\n            `Item durability is now ${durabilityComponent.damage}/${durabilityComponent.maxDurability}`\r\n        );\r\n        equippable.setEquipment(options.slot, item);\r\n        return true;\r\n    }\r\n    /**\r\n     * Returns the chance to consume durability from item based on the unbreaking level.\r\n     * @param unbreakingLevel - The unbreaking level of the item.\r\n     * @returns The chance to consume durability from item based on the unbreaking level.\r\n     */\r\n    public static getUnbreakingChance(unbreakingLevel: number) {\r\n        if (unbreakingLevel === 0) {\r\n            return 1;\r\n        }\r\n        return 1 / (unbreakingLevel + 1);\r\n    }\r\n}\r\n","import { Entity } from '@minecraft/server';\r\nimport Vec3 from '../math/Vec3';\r\n\r\nexport interface EntityHitbox {\r\n    bound: Vec3;\r\n    location: Vec3;\r\n    offset: Vec3;\r\n}\r\n\r\nexport class EntityUtils {\r\n    /**\r\n     * Finds the hitbox dimensions, base corner location, and offset of an entity.\r\n     * @param entity The target entity.\r\n     * @param maxWidth Maximum search width (default: 5 blocks).\r\n     * @param maxHeight Maximum search height (default: 5 blocks).\r\n     * @returns Object with hitbox size (`bound`), corner location (`location`), and offset. Returns `null` if invalid.\r\n     */\r\n    static findEntityHitbox(\r\n        entity: Entity,\r\n        maxWidth: number = 5,\r\n        maxHeight: number = maxWidth\r\n    ): EntityHitbox | null {\r\n        if (!entity?.isValid) return null;\r\n\r\n        const location = Vec3.from(entity.location);\r\n        const dimension = entity.dimension;\r\n\r\n        const raycastDistance = (\r\n            origin: Vec3,\r\n            dirVec: Vec3,\r\n            maxDist: number\r\n        ) => {\r\n            const rayDistance = dimension\r\n                .getEntitiesFromRay(origin, dirVec, {\r\n                    type: entity.typeId,\r\n                    ignoreBlockCollision: true,\r\n                    maxDistance: maxDist + 2,\r\n                })\r\n                ?.find((hit) => hit.entity === entity)?.distance;\r\n\r\n            return maxDist - (rayDistance ?? maxDist);\r\n        };\r\n\r\n        const upperHeight = raycastDistance(\r\n            location.add(0, maxHeight, 0),\r\n            Vec3.Down,\r\n            maxHeight\r\n        );\r\n\r\n        const lowerHeight = raycastDistance(\r\n            location.add(0, -maxHeight, 0),\r\n            Vec3.Up,\r\n            maxHeight\r\n        );\r\n\r\n        const rightWidth = raycastDistance(\r\n            location.add(maxWidth, 0, 0),\r\n            Vec3.from(-1, 0.0001, 0),\r\n            maxWidth\r\n        );\r\n\r\n        const leftWidth = raycastDistance(\r\n            location.add(-maxWidth, 0, 0),\r\n            Vec3.from(1, 0.0001, 0),\r\n            maxWidth\r\n        );\r\n\r\n        const frontLength = raycastDistance(\r\n            location.add(0, 0, maxWidth),\r\n            Vec3.from(0, 0.0001, -1),\r\n            maxWidth\r\n        );\r\n\r\n        const backLength = raycastDistance(\r\n            location.add(0, 0, -maxWidth),\r\n            Vec3.from(0, 0.0001, 1),\r\n            maxWidth\r\n        );\r\n\r\n        const height = upperHeight + lowerHeight;\r\n        const width = rightWidth + leftWidth;\r\n        const length = frontLength + backLength;\r\n\r\n        if (height === 0 || width === 0 || length === 0) return null;\r\n\r\n        const bound = Vec3.from(width, height, length);\r\n        const offset = Vec3.from(-leftWidth, -lowerHeight, -backLength);\r\n        const finalLocation = location.add(offset);\r\n\r\n        return {\r\n            bound,\r\n            location: finalLocation,\r\n            offset,\r\n        };\r\n    }\r\n}\r\n","//#region Types & error helpers\n\ntype Path = (string | number)[];\n\n/**\n * Machine-readable error codes produced by schema validation.\n *\n * @remarks Each member maps to a stable numeric identifier so consumers can\n * branch on validation failures without brittle string matching.\n */\nexport enum ValidationIssueCode {\n    /** Value was required but missing or `undefined`. */\n    Required = 1,\n    /** Encountered `null` where a string was expected. */\n    StringNull = 2,\n    /** Encountered a non-string value. */\n    StringType = 3,\n    /** String must not be empty. */\n    StringEmpty = 4,\n    /** String length fell below the configured minimum. */\n    StringTooShort = 5,\n    /** String length exceeded the configured maximum. */\n    StringTooLong = 6,\n    /** String failed to match the configured regular expression. */\n    StringRegexMismatch = 7,\n    /** Encountered `null` where a number was expected. */\n    NumberNull = 8,\n    /** Encountered a non-number value or NaN. */\n    NumberType = 9,\n    /** Expected an integer but received a fractional value. */\n    NumberNotInteger = 10,\n    /** Number fell below an inclusive minimum. */\n    NumberTooSmall = 11,\n    /** Number failed to satisfy a strict greater-than comparison. */\n    NumberTooSmallExclusive = 12,\n    /** Number exceeded an inclusive maximum. */\n    NumberTooLarge = 13,\n    /** Number failed to satisfy a strict less-than comparison. */\n    NumberTooLargeExclusive = 14,\n    /** Encountered `null` where a boolean was expected. */\n    BooleanNull = 15,\n    /** Encountered a non-boolean value. */\n    BooleanType = 16,\n    /** Value did not match the expected literal. */\n    LiteralMismatch = 17,\n    /** Encountered `null` where an enum value was expected. */\n    EnumNull = 18,\n    /** Value was not one of the allowed enum options. */\n    EnumMismatch = 19,\n    /** Encountered `null` where an array was expected. */\n    ArrayNull = 20,\n    /** Encountered a non-array value. */\n    ArrayType = 21,\n    /** Array length failed to match an exact requirement. */\n    ArrayExactLengthMismatch = 22,\n    /** Array length fell below the configured minimum. */\n    ArrayTooShort = 23,\n    /** Array length exceeded the configured maximum. */\n    ArrayTooLong = 24,\n    /** Encountered `null` where a tuple was expected. */\n    TupleNull = 25,\n    /** Encountered a non-array value where a tuple was expected. */\n    TupleType = 26,\n    /** Tuple length did not match its schema definition. */\n    TupleLengthMismatch = 27,\n    /** Encountered `null` where no union option permits it. */\n    UnexpectedNull = 28,\n    /** No union option accepted the provided value. */\n    UnionNoMatch = 29,\n    /** Encountered `null` where an object was expected. */\n    ObjectNull = 30,\n    /** Encountered a non-object value. */\n    ObjectType = 31,\n    /** Object contained a property that is not allowed. */\n    ObjectUnknownKey = 32,\n    /** Custom refinement predicate returned false. */\n    RefinementFailed = 33,\n}\n\nexport type ValidationIssue = {\n    path: string; // e.g. $.player.location.x\n    message: string;\n    code: ValidationIssueCode;\n};\n\n/**\n * Aggregated validation failure produced by {@link Schema.parse}.\n *\n * @public\n */\nexport class ValidationError extends Error {\n    /**\n     * Creates a new validation error that exposes all collected issues.\n     *\n     * @param issues - Structured report for each failed path.\n     */\n    constructor(public issues: ValidationIssue[]) {\n        super(issues.map((i) => `${i.path}: ${i.message}`).join('\\n'));\n        this.name = 'ValidationError';\n    }\n}\n\nexport type SafeParseSuccess<T> = { success: true; data: T };\nexport type SafeParseFailure = { success: false; errors: ValidationIssue[] };\nexport type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseFailure;\n\n/**\n * Converts a validation path into a human-readable string for error reporting.\n *\n * @param path - Sequence of object keys and array indices describing location.\n * @returns Path string using JSONPath-like formatting (e.g. `$.foo[0]`).\n */\nfunction pathToString(path: Path): string {\n    if (path.length === 0) return '$';\n    let s = '$';\n    for (const p of path) s += typeof p === 'number' ? `[${p}]` : `.${p}`;\n    return s;\n}\n\n//#region Public Schema interface\n\n/**\n * Type-safe runtime validator and transformer for a value of type {@link T}.\n *\n * @public\n */\nexport interface Schema<T> {\n    /**\n     * Validates and returns a value when all schema constraints pass.\n     *\n     * @param value - Raw input to validate.\n     * @returns The parsed value if validation succeeds.\n     * @throws ValidationError Thrown when validation fails.\n     */\n    parse(value: unknown): T;\n    /**\n     * Validates the value in place, throwing if it does not satisfy the schema.\n     *\n     * @param value - Raw input to validate.\n     * @throws ValidationError Thrown when validation fails.\n     */\n    assert(value: unknown): asserts value is T;\n    /**\n     * Attempts to parse a value without throwing.\n     *\n     * @param value - Raw input to validate.\n     * @returns Success with parsed data or failure with validation issues.\n     */\n    safeParse(value: unknown): SafeParseResult<T>;\n\n    /**\n     * Allows `undefined` in addition to the current schema.\n     *\n     * @returns A schema permitting `undefined`.\n     */\n    optional(): Schema<T | undefined>;\n    /**\n     * Removes `undefined` from the accepted set of values.\n     *\n     * @returns The current schema with `undefined` disallowed.\n     */\n    required(): this;\n    /**\n     * Allows `null` in addition to the current schema.\n     *\n     * @returns A schema permitting `null`.\n     */\n    nullable(): Schema<T | null>;\n    /**\n     * Adds a custom predicate to refine acceptable values.\n     *\n     * @param pred - Predicate returning `true` when the value is valid.\n     * @param message - Human friendly description shown on failure.\n     * @param code - Optional machine readable identifier for the failure.\n     * @returns A schema reflecting the additional refinement.\n     */\n    refine(\n        pred: (v: T) => boolean,\n        message: string,\n        code?: ValidationIssueCode\n    ): Schema<T>;\n}\n\n//#region Base schema (mutating)\n\n/**\n * Provides default behaviour for schema refinements, optionality, and parsing.\n */\nabstract class BaseSchema<T> implements Schema<T> {\n    protected _refinements: Array<{\n        pred: (v: T) => boolean;\n        message: string;\n        code?: ValidationIssueCode;\n    }> = [];\n    protected _isOptional = false;\n    protected _isNullable = false;\n\n    /**\n     * Marks the schema as accepting `undefined` values without cloning.\n     *\n     * @returns The current schema configured to allow `undefined`.\n     */\n    optional(): Schema<T | undefined> {\n        this._isOptional = true;\n        return this as unknown as Schema<T | undefined>;\n    }\n    /**\n     * Marks the schema as disallowing `undefined` values.\n     *\n     * @returns The current schema with optional flag cleared.\n     */\n    required(): this {\n        this._isOptional = false;\n        return this;\n    }\n    /**\n     * Marks the schema as accepting `null` values without cloning.\n     *\n     * @returns The current schema configured to allow `null`.\n     */\n    nullable(): Schema<T | null> {\n        this._isNullable = true;\n        return this as unknown as Schema<T | null>;\n    }\n    /**\n     * Appends a refinement predicate that runs after core validation succeeds.\n     *\n     * @param pred - Predicate invoked with the parsed value.\n     * @param message - Error message used when the predicate fails.\n     * @param code - Optional issue code to classify the refinement failure.\n     * @returns The current schema with the refinement registered.\n     */\n    refine(\n        pred: (v: T) => boolean,\n        message: string,\n        code?: ValidationIssueCode\n    ): Schema<T> {\n        this._refinements.push({ pred, message, code });\n        return this;\n    }\n\n    /**\n     * Ensures the provided value satisfies the schema, throwing on failure.\n     *\n     * @param value - Value to validate.\n     * @throws ValidationError When validation fails.\n     */\n    assert(value: unknown): asserts value is T {\n        this.parse(value);\n    }\n\n    /**\n     * Attempts to parse a value and capture failures without throwing.\n     *\n     * @param value - Value to validate.\n     * @returns Success with the parsed value or failure with collected issues.\n     */\n    safeParse(value: unknown): SafeParseResult<T> {\n        try {\n            return { success: true, data: this.parse(value) };\n        } catch (e) {\n            if (e instanceof ValidationError)\n                return { success: false, errors: e.issues };\n            throw e;\n        }\n    }\n\n    /**\n     * Parses a value using the schema and executes refinements on success.\n     *\n     * @param value - Value to validate.\n     * @returns The parsed value when validation succeeds.\n     * @throws ValidationError When validation or refinement fails.\n     */\n    parse(value: unknown): T {\n        const issues: ValidationIssue[] = [];\n        const out = this._validate(\n            value,\n            [],\n            issues,\n            this._isOptional,\n            this._isNullable\n        );\n        if (issues.length) throw new ValidationError(issues);\n        if (out !== undefined && out !== null) {\n            for (const r of this._refinements) {\n                if (!r.pred(out as T)) {\n                    throw new ValidationError([\n                        {\n                            path: '$',\n                            message: r.message,\n                            code:\n                                r.code ?? ValidationIssueCode.RefinementFailed,\n                        },\n                    ]);\n                }\n            }\n        }\n        return out as T;\n    }\n\n    /**\n     * Call a child schema's internal validator without protected-access errors.\n     *\n     * @param schema - Child schema to delegate to.\n     * @param value - Value to validate.\n     * @param path - Current traversal path.\n     * @param issues - Mutable issue collection shared across validations.\n     * @returns Result produced by the child schema.\n     */\n    protected _validateChild<U>(\n        schema: Schema<U>,\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[]\n    ): U | undefined | null {\n        const s = schema as BaseSchema<U>;\n        return s._validate(value, path, issues, s._isOptional, s._isNullable);\n    }\n\n    /**\n     * Core validation hook implemented by concrete schema types.\n     *\n     * @param value - Value to validate.\n     * @param path - Current traversal path.\n     * @param issues - Mutable issue collection shared across validations.\n     * @param optional - Whether `undefined` should be accepted.\n     * @param nullable - Whether `null` should be accepted.\n     */\n    protected abstract _validate(\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[],\n        optional: boolean,\n        nullable: boolean\n    ): T | undefined | null;\n\n    /**\n     * Records a validation issue with a positional path and machine code.\n     *\n     * @param issues - Aggregate issue collection to append to.\n     * @param path - Traversal path where the issue occurred.\n     * @param message - Human readable explanation of the failure.\n     * @param code - Machine readable classification of the failure.\n     */\n    protected issue(\n        issues: ValidationIssue[],\n        path: Path,\n        message: string,\n        code: ValidationIssueCode\n    ) {\n        issues.push({ path: pathToString(path), message, code });\n    }\n}\n\n//#region Primitive schemas\n\nclass StringSchema extends BaseSchema<string> {\n    private _min?: number;\n    private _max?: number;\n    private _regex?: RegExp;\n    private _nonEmpty = false;\n\n    /**\n     * Requires strings to have a length greater than or equal to the given number.\n     *\n     * @param n - Minimum length permitted.\n     * @returns The current schema with the constraint applied.\n     */\n    min(n: number) {\n        this._min = n;\n        return this;\n    }\n    /**\n     * Requires strings to have a length less than or equal to the given number.\n     *\n     * @param n - Maximum length permitted.\n     * @returns The current schema with the constraint applied.\n     */\n    max(n: number) {\n        this._max = n;\n        return this;\n    }\n    /**\n     * Requires strings to match a specific regular expression.\n     *\n     * @param r - Regular expression the value must satisfy.\n     * @returns The current schema with the constraint applied.\n     */\n    regex(r: RegExp) {\n        this._regex = r;\n        return this;\n    }\n    /**\n     * Disallows empty strings.\n     *\n     * @returns The current schema with the constraint applied.\n     */\n    notEmpty() {\n        this._nonEmpty = true;\n        return this;\n    }\n\n    /**\n     * Validates a candidate string value against configured constraints.\n     *\n     * @inheritdoc\n     */\n    protected _validate(\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[],\n        optional: boolean,\n        nullable: boolean\n    ) {\n        if (value === undefined) {\n            if (optional) return undefined as any;\n            this.issue(issues, path, 'Required', ValidationIssueCode.Required);\n            return undefined as any;\n        }\n        if (value === null) {\n            if (nullable) return null as any;\n            this.issue(\n                issues,\n                path,\n                'Expected string, got null',\n                ValidationIssueCode.StringNull\n            );\n            return undefined as any;\n        }\n        if (typeof value !== 'string') {\n            this.issue(\n                issues,\n                path,\n                `Expected string, got ${typeof value}`,\n                ValidationIssueCode.StringType\n            );\n            return undefined as any;\n        }\n        if (this._nonEmpty && value.length === 0)\n            this.issue(\n                issues,\n                path,\n                'String must not be empty',\n                ValidationIssueCode.StringEmpty\n            );\n        if (this._min !== undefined && value.length < this._min)\n            this.issue(\n                issues,\n                path,\n                `String length < ${this._min}`,\n                ValidationIssueCode.StringTooShort\n            );\n        if (this._max !== undefined && value.length > this._max)\n            this.issue(\n                issues,\n                path,\n                `String length > ${this._max}`,\n                ValidationIssueCode.StringTooLong\n            );\n        if (this._regex && !this._regex.test(value))\n            this.issue(\n                issues,\n                path,\n                `String does not match ${this._regex}`,\n                ValidationIssueCode.StringRegexMismatch\n            );\n        return value;\n    }\n}\n\nclass NumberSchema extends BaseSchema<number> {\n    private _int = false;\n    private _min?: number;\n    private _max?: number;\n    private _gt?: number;\n    private _lt?: number;\n\n    /**\n     * Restricts numbers to integers.\n     *\n     * @returns The current schema with the constraint applied.\n     */\n    int() {\n        this._int = true;\n        return this;\n    }\n    /**\n     * Requires numbers to be greater than or equal to the provided minimum.\n     *\n     * @param n - Minimum inclusive value.\n     * @returns The current schema with the constraint applied.\n     */\n    min(n: number) {\n        this._min = n;\n        return this;\n    }\n    /**\n     * Requires numbers to be less than or equal to the provided maximum.\n     *\n     * @param n - Maximum inclusive value.\n     * @returns The current schema with the constraint applied.\n     */\n    max(n: number) {\n        this._max = n;\n        return this;\n    }\n    /**\n     * Requires numbers to be strictly greater than the provided bound.\n     *\n     * @param n - Exclusive lower bound.\n     * @returns The current schema with the constraint applied.\n     */\n    gt(n: number) {\n        this._gt = n;\n        return this;\n    }\n    /**\n     * Requires numbers to be strictly less than the provided bound.\n     *\n     * @param n - Exclusive upper bound.\n     * @returns The current schema with the constraint applied.\n     */\n    lt(n: number) {\n        this._lt = n;\n        return this;\n    }\n    /**\n     * Convenience helper for values greater than or equal to zero.\n     *\n     * @returns The current schema with the constraint applied.\n     */\n    nonNegative() {\n        return this.min(0);\n    }\n    /**\n     * Convenience helper for values strictly greater than zero.\n     *\n     * @returns The current schema with the constraint applied.\n     */\n    positive() {\n        return this.gt(0);\n    }\n\n    /**\n     * Validates a numeric candidate against configured constraints.\n     *\n     * @inheritdoc\n     */\n    protected _validate(\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[],\n        optional: boolean,\n        nullable: boolean\n    ) {\n        if (value === undefined) {\n            if (optional) return undefined as any;\n            this.issue(issues, path, 'Required', ValidationIssueCode.Required);\n            return undefined as any;\n        }\n        if (value === null) {\n            if (nullable) return null as any;\n            this.issue(\n                issues,\n                path,\n                'Expected number, got null',\n                ValidationIssueCode.NumberNull\n            );\n            return undefined as any;\n        }\n        if (typeof value !== 'number' || Number.isNaN(value)) {\n            this.issue(\n                issues,\n                path,\n                `Expected number, got ${typeof value}`,\n                ValidationIssueCode.NumberType\n            );\n            return undefined as any;\n        }\n        if (this._int && !Number.isInteger(value))\n            this.issue(\n                issues,\n                path,\n                'Expected integer',\n                ValidationIssueCode.NumberNotInteger\n            );\n        if (this._min !== undefined && value < this._min)\n            this.issue(\n                issues,\n                path,\n                `Number < ${this._min}`,\n                ValidationIssueCode.NumberTooSmall\n            );\n        if (this._gt !== undefined && !(value > this._gt))\n            this.issue(\n                issues,\n                path,\n                `Number must be > ${this._gt}`,\n                ValidationIssueCode.NumberTooSmallExclusive\n            );\n        if (this._max !== undefined && value > this._max)\n            this.issue(\n                issues,\n                path,\n                `Number > ${this._max}`,\n                ValidationIssueCode.NumberTooLarge\n            );\n        if (this._lt !== undefined && !(value < this._lt))\n            this.issue(\n                issues,\n                path,\n                `Number must be < ${this._lt}`,\n                ValidationIssueCode.NumberTooLargeExclusive\n            );\n        return value;\n    }\n}\n\nclass BooleanSchema extends BaseSchema<boolean> {\n    /**\n     * Validates that a value is a boolean while respecting optional/nullable flags.\n     *\n     * @inheritdoc\n     */\n    protected _validate(\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[],\n        optional: boolean,\n        nullable: boolean\n    ) {\n        if (value === undefined) {\n            if (optional) return undefined as any;\n            this.issue(issues, path, 'Required', ValidationIssueCode.Required);\n            return undefined as any;\n        }\n        if (value === null) {\n            if (nullable) return null as any;\n            this.issue(\n                issues,\n                path,\n                'Expected boolean, got null',\n                ValidationIssueCode.BooleanNull\n            );\n            return undefined as any;\n        }\n        if (typeof value !== 'boolean') {\n            this.issue(\n                issues,\n                path,\n                `Expected boolean, got ${typeof value}`,\n                ValidationIssueCode.BooleanType\n            );\n            return undefined as any;\n        }\n        return value;\n    }\n}\n\nclass LiteralSchema<\n    V extends string | number | boolean | null,\n> extends BaseSchema<V> {\n    /**\n     * @param _value - Literal value the schema must match.\n     */\n    constructor(private _value: V) {\n        super();\n    }\n    /**\n     * Validates that an input exactly matches the configured literal.\n     *\n     * @inheritdoc\n     */\n    protected _validate(\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[],\n        optional: boolean,\n        //LiteralSchema can only be null if the literal is null\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n        nullable: boolean\n    ) {\n        if (value === undefined) {\n            if (optional) return undefined as any;\n            this.issue(issues, path, 'Required', ValidationIssueCode.Required);\n            return undefined as any;\n        }\n        if (this._value === null) {\n            if (value !== null) {\n                this.issue(\n                    issues,\n                    path,\n                    `Expected literal ${JSON.stringify(this._value)}`,\n                    ValidationIssueCode.LiteralMismatch\n                );\n                return undefined as any;\n            }\n            return null as any;\n        }\n        if (value !== this._value) {\n            this.issue(\n                issues,\n                path,\n                `Expected literal ${JSON.stringify(this._value)}`,\n                ValidationIssueCode.LiteralMismatch\n            );\n            return undefined as any;\n        }\n        return value as V;\n    }\n}\n\nclass EnumSchema<T extends string | number> extends BaseSchema<T> {\n    private _set: Set<T>;\n    /**\n     * @param values - Collection of allowed enum values.\n     */\n    constructor(values: readonly T[]) {\n        super();\n        this._set = new Set(values);\n    }\n    /**\n     * Validates that an input belongs to the configured enum set.\n     *\n     * @inheritdoc\n     */\n    protected _validate(\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[],\n        optional: boolean,\n        nullable: boolean\n    ) {\n        if (value === undefined) {\n            if (optional) return undefined as any;\n            this.issue(issues, path, 'Required', ValidationIssueCode.Required);\n            return undefined as any;\n        }\n        if (value === null) {\n            if (nullable) return null as any;\n            this.issue(\n                issues,\n                path,\n                'Expected enum value, got null',\n                ValidationIssueCode.EnumNull\n            );\n            return undefined as any;\n        }\n        if (!this._set.has(value as any)) {\n            this.issue(\n                issues,\n                path,\n                `Expected one of ${[...this._set].map(String).join(', ')}`,\n                ValidationIssueCode.EnumMismatch\n            );\n            return undefined as any;\n        }\n        return value as T;\n    }\n}\n\n//#region Composite schemas\n\nclass ArraySchema<T> extends BaseSchema<T[]> {\n    private _min?: number;\n    private _max?: number;\n    private _exact?: number;\n\n    /**\n     * @param element - Schema used to validate each array element.\n     */\n    constructor(private element: Schema<T>) {\n        super();\n    }\n\n    /**\n     * Requires arrays to have at least the given number of elements.\n     *\n     * @param n - Minimum length permitted.\n     * @returns The current schema with the constraint applied.\n     */\n    min(n: number) {\n        this._min = n;\n        return this;\n    }\n    /**\n     * Requires arrays to have at most the given number of elements.\n     *\n     * @param n - Maximum length permitted.\n     * @returns The current schema with the constraint applied.\n     */\n    max(n: number) {\n        this._max = n;\n        return this;\n    }\n    /**\n     * Requires arrays to have an exact length.\n     *\n     * @param n - Exact size the array must match.\n     * @returns The current schema with the constraint applied.\n     */\n    size(n: number) {\n        this._exact = n;\n        return this;\n    } // exact length\n\n    /**\n     * Validates array structure and each element against configured constraints.\n     *\n     * @inheritdoc\n     */\n    protected _validate(\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[],\n        optional: boolean,\n        nullable: boolean\n    ) {\n        if (value === undefined) {\n            if (optional) return undefined as any;\n            this.issue(issues, path, 'Required', ValidationIssueCode.Required);\n            return undefined as any;\n        }\n        if (value === null) {\n            if (nullable) return null as any;\n            this.issue(\n                issues,\n                path,\n                'Expected array, got null',\n                ValidationIssueCode.ArrayNull\n            );\n            return undefined as any;\n        }\n        if (!Array.isArray(value)) {\n            this.issue(\n                issues,\n                path,\n                'Expected array',\n                ValidationIssueCode.ArrayType\n            );\n            return undefined as any;\n        }\n\n        const arr = value;\n        if (this._exact !== undefined && arr.length !== this._exact)\n            this.issue(\n                issues,\n                path,\n                `Array length must be ${this._exact}`,\n                ValidationIssueCode.ArrayExactLengthMismatch\n            );\n        if (this._min !== undefined && arr.length < this._min)\n            this.issue(\n                issues,\n                path,\n                `Array length < ${this._min}`,\n                ValidationIssueCode.ArrayTooShort\n            );\n        if (this._max !== undefined && arr.length > this._max)\n            this.issue(\n                issues,\n                path,\n                `Array length > ${this._max}`,\n                ValidationIssueCode.ArrayTooLong\n            );\n\n        const out: T[] = new Array(arr.length);\n        for (let i = 0; i < arr.length; i++) {\n            path.push(i);\n            const r = this._validateChild(this.element, arr[i], path, issues);\n            path.pop();\n            out[i] = r as T;\n        }\n        return out;\n    }\n}\n\nclass TupleSchema<T extends any[]> extends BaseSchema<T> {\n    /**\n     * @param elements - Ordered list of schemas for each tuple index.\n     */\n    constructor(private elements: { [K in keyof T]: Schema<T[K]> }) {\n        super();\n    }\n\n    /**\n     * Validates tuple length and delegates element validation to child schemas.\n     *\n     * @inheritdoc\n     */\n    protected _validate(\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[],\n        optional: boolean,\n        nullable: boolean\n    ) {\n        if (value === undefined) {\n            if (optional) return undefined as any;\n            this.issue(issues, path, 'Required', ValidationIssueCode.Required);\n            return undefined as any;\n        }\n        if (value === null) {\n            if (nullable) return null as any;\n            this.issue(\n                issues,\n                path,\n                'Expected tuple, got null',\n                ValidationIssueCode.TupleNull\n            );\n            return undefined as any;\n        }\n        if (!Array.isArray(value)) {\n            this.issue(\n                issues,\n                path,\n                'Expected tuple (array)',\n                ValidationIssueCode.TupleType\n            );\n            return undefined as any;\n        }\n        if (value.length !== this.elements.length)\n            this.issue(\n                issues,\n                path,\n                `Tuple length must be ${this.elements.length}`,\n                ValidationIssueCode.TupleLengthMismatch\n            );\n\n        const out: any[] = new Array(this.elements.length);\n        for (let i = 0; i < this.elements.length; i++) {\n            path.push(i);\n            const r = this._validateChild(\n                this.elements[i],\n                value[i],\n                path,\n                issues\n            );\n            path.pop();\n            out[i] = r;\n        }\n        return out as T;\n    }\n}\n\nclass UnionSchema<T> extends BaseSchema<T> {\n    /**\n     * @param options - Collection of schemas representing union variants.\n     */\n    constructor(private options: Schema<any>[]) {\n        super();\n    }\n\n    /**\n     * Validates that the value matches at least one union variant.\n     *\n     * @inheritdoc\n     */\n    protected _validate(\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[],\n        optional: boolean,\n        nullable: boolean\n    ) {\n        if (value === undefined) {\n            if (optional) return undefined as any;\n            this.issue(issues, path, 'Required', ValidationIssueCode.Required);\n            return undefined as any;\n        }\n        if (value === null) {\n            if (nullable) return null as any;\n            this.issue(\n                issues,\n                path,\n                'Unexpected null',\n                ValidationIssueCode.UnexpectedNull\n            );\n            return undefined as any;\n        }\n\n        const subIssues: ValidationIssue[][] = [];\n        for (const opt of this.options) {\n            const optIssues: ValidationIssue[] = [];\n            const r = this._validateChild(opt, value, path, optIssues);\n            if (optIssues.length === 0) return r as T;\n            subIssues.push(optIssues);\n        }\n        const msgs = subIssues\n            .slice(0, 3)\n            .flat()\n            .map((i) => i.message)\n            .join(' | ');\n        this.issue(\n            issues,\n            path,\n            `No union variant matched: ${msgs}`,\n            ValidationIssueCode.UnionNoMatch\n        );\n        return undefined as any;\n    }\n}\n\n//#region Object schema & builder\n\ntype PropSpec = { schema: Schema<any> };\ntype PropsRecord = Record<string, PropSpec>;\ntype InferSchema<S> = S extends Schema<infer T> ? T : never;\ntype InferProps<P extends PropsRecord> = {\n    [K in keyof P]: InferSchema<P[K]['schema']>;\n};\n\nclass ObjectSchema<\n    P extends PropsRecord,\n    Out extends object,\n> extends BaseSchema<Out> {\n    /**\n     * @param name - Optional descriptive name for error messages.\n     * @param props - Map of property schemas defining the object shape.\n     * @param _allowUnknown - Whether properties outside `props` are preserved.\n     */\n    constructor(\n        private name: string | undefined,\n        private props: P,\n        private _allowUnknown = false\n    ) {\n        super();\n    }\n\n    /**\n     * Validates object structure, known properties, and unknown-key policy.\n     *\n     * @inheritdoc\n     */\n    protected _validate(\n        value: unknown,\n        path: Path,\n        issues: ValidationIssue[],\n        optional: boolean,\n        nullable: boolean\n    ): Out {\n        if (value === undefined) {\n            if (optional) return undefined as any;\n            this.issue(issues, path, 'Required', ValidationIssueCode.Required);\n            return undefined as any;\n        }\n        if (value === null) {\n            if (nullable) return null as any;\n            this.issue(\n                issues,\n                path,\n                'Expected object, got null',\n                ValidationIssueCode.ObjectNull\n            );\n            return undefined as any;\n        }\n        if (typeof value !== 'object' || Array.isArray(value)) {\n            this.issue(\n                issues,\n                path,\n                'Expected object',\n                ValidationIssueCode.ObjectType\n            );\n            return undefined as any;\n        }\n\n        const v = value as Record<string, unknown>;\n        const out: any = {};\n\n        // known props\n        for (const key in this.props) {\n            path.push(key);\n            const schema = this.props[key].schema;\n            const r = this._validateChild(schema, v[key], path, issues);\n            path.pop();\n            if (r !== undefined) out[key] = r;\n            else if (Object.prototype.hasOwnProperty.call(v, key)) out[key] = r; // preserve explicit undefined\n        }\n\n        // unknown keys handling\n        if (!this._allowUnknown) {\n            for (const k in v) {\n                if (!(k in this.props)) {\n                    path.push(k);\n                    this.issue(\n                        issues,\n                        path,\n                        'Unknown property',\n                        ValidationIssueCode.ObjectUnknownKey\n                    );\n                    path.pop();\n                }\n            }\n        } else {\n            for (const k in v) if (!(k in this.props)) out[k] = v[k];\n        }\n\n        return out;\n    }\n}\n\n/**\n * Fluent object schema builder that produces {@link Schema} instances.\n *\n * @public\n */\nexport class ObjectBuilder<P extends PropsRecord> {\n    private _allowUnknown = false;\n    constructor(\n        private name: string | undefined,\n        private props: P\n    ) {}\n\n    /**\n     * Adds a property schema to the current builder.\n     *\n     * @typeParam K - Property name being added.\n     * @typeParam S - Schema that validates the property.\n     * @param key - Object key to associate with the schema.\n     * @param schema - Schema that validates the property value.\n     * @returns The builder with an updated type signature.\n     */\n    property<K extends string, S extends Schema<any>>(\n        key: K,\n        schema: S\n    ): ObjectBuilder<P & { [Q in K]: { schema: S } }> {\n        (this.props as any)[key] = { schema };\n        return this as unknown as ObjectBuilder<\n            P & { [Q in K]: { schema: S } }\n        >;\n    }\n\n    /**\n     * Permits keys not explicitly defined in the builder.\n     *\n     * @returns The current builder with unknown-key support enabled.\n     */\n    allowUnknown(): this {\n        this._allowUnknown = true;\n        return this;\n    }\n\n    /**\n     * Finalises and freezes the builder into an object schema.\n     *\n     * @returns An immutable schema that validates the configured shape.\n     */\n    build(): ObjectSchema<P, InferProps<P>> {\n        const frozen = Object.freeze({ ...(this.props as any) }) as P;\n        return new ObjectSchema<P, InferProps<P>>(\n            this.name,\n            frozen,\n            this._allowUnknown\n        );\n    }\n\n    /**\n     * Convenience wrapper that returns the built schema directly.\n     *\n     * @returns A schema equivalent to the result of {@link build}.\n     */\n    asSchema(): Schema<InferProps<P>> {\n        return this.build();\n    }\n}\n\n//#region Factory (public API)\n\n/**\n * Factory helpers for constructing common {@link Schema} variants.\n *\n * @public\n */\nexport const TypeBuilder = {\n    // primitives\n    /**\n     * Creates a schema that validates string values.\n     *\n     * @returns A string schema.\n     */\n    string: () => new StringSchema(),\n    /**\n     * Creates a schema that validates numeric values.\n     *\n     * @returns A number schema.\n     */\n    number: () => new NumberSchema(),\n    /**\n     * Creates a schema that validates boolean values.\n     *\n     * @returns A boolean schema.\n     */\n    boolean: () => new BooleanSchema(),\n    /**\n     * Creates a schema that accepts a single literal value.\n     *\n     * @typeParam V - Literal value type.\n     * @param v - Literal value the schema must match.\n     * @returns A literal schema.\n     */\n    literal: <V extends string | number | boolean | null>(v: V) =>\n        new LiteralSchema(v),\n    /**\n     * Creates a schema that validates members of an enum-like collection.\n     *\n     * @typeParam T - Enumeration member type.\n     * @param values - Allowed values for the enum.\n     * @returns An enum schema.\n     */\n    enum: <T extends string | number>(values: readonly T[]) =>\n        new EnumSchema(values),\n\n    // arrays & tuples\n    /**\n     * Creates a schema that validates arrays of another schema.\n     *\n     * @typeParam T - Element type validated by `elem`.\n     * @param elem - Schema for each array element.\n     * @returns An array schema.\n     */\n    array: <T>(elem: Schema<T>) => new ArraySchema(elem),\n    /**\n     * Creates a schema that validates tuples with positional schemas.\n     *\n     * @typeParam T - Tuple element types.\n     * @param elements - Schema for each tuple member.\n     * @returns A tuple schema.\n     */\n    tuple: <T extends any[]>(...elements: { [K in keyof T]: Schema<T[K]> }) =>\n        new TupleSchema<T>(elements as any),\n\n    // unions\n    /**\n     * Creates a schema that accepts one of two possible shapes.\n     *\n     * @typeParam A - First schema type.\n     * @typeParam B - Second schema type.\n     * @param a - Schema for the first option.\n     * @param b - Schema for the second option.\n     * @returns A union schema covering both input schemas.\n     */\n    union: <A, B>(a: Schema<A>, b: Schema<B>): Schema<A | B> =>\n        new UnionSchema<any>([a, b]),\n    /**\n     * Creates a schema that accepts any of the provided options.\n     *\n     * @typeParam T - Tuple of schema types.\n     * @param options - Schemas for each union variant.\n     * @returns A union schema covering all provided schemas.\n     */\n    oneOf: <T extends any[]>(...options: { [K in keyof T]: Schema<T[K]> }) =>\n        new UnionSchema<any>(options as any),\n\n    // objects (ESLint-safe default type)\n    /**\n     * Starts building an object schema through {@link ObjectBuilder}.\n     *\n     * @typeParam P - Property record type.\n     * @param name - Optional human-readable schema name.\n     * @returns A new object schema builder.\n     */\n    object: <P extends PropsRecord = Record<string, never>>(name?: string) =>\n        new ObjectBuilder<P>(name, {} as P),\n};\n"],"mappings":";AAAA;AAAA,EAEI,aAAAA;AAAA,EAEA,qBAAAC;AAAA,OACG;;;ACLP;AAAA,EAGI;AAAA,EACA;AAAA,OACG;AAMP,IAAqB,UAArB,MAAqB,SAA2B;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EAQA,YAAY,GAAe,GAAY,GAAY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;AAAA;AAAA;AAAA,EAQ/B,OAAO,IAAqB,YACxB,IAAI,YAAiB,OAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUvC,QAAQ,CAAgD,SACpD,IAAI,cAAiB,MAAM,CAAC,CAAM;AAC1C;","names":["Direction","StructureRotation","OutputType","Direction","StructureRotation","Direction","Direction","Direction","Direction","world","world","world","system","system","system","system","system","world","world","system","Player","system","world","world","system","Player","InputPermission","CameraShakeType","SlotLocation","system","Direction","world","world","log","ValidationIssueCode"]}