UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

46 lines (45 loc) 1.17 kB
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Block_1 = __importDefault(require("./Block")); class BlockVolumeLine { _cube; _plane; _y; get cube() { return this._cube; } get y() { return this._y; } get x() { return this._plane.x; } get plane() { return this._plane; } blocks; constructor(cube, plane, y) { this.blocks = []; this._cube = cube; this._plane = plane; this._y = y; } z(z) { if (z > this._cube.maxZ) { throw new Error("Value exceeds maximum Z"); } while (z >= this.blocks.length) { const block = new Block_1.default(undefined); block.line = this; block.z = this.blocks.length; this.blocks[this.blocks.length] = block; } return this.blocks[z]; } } exports.default = BlockVolumeLine;