UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

93 lines (92 loc) 2.74 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 BlockActor_1 = __importDefault(require("./BlockActor")); class CommandBlockActor extends BlockActor_1.default { command; customName; executeOnFirstTick; lpCommandMode; lpConditionalMode; lpRedstoneMode; lastExecution; lastOutput; lastOutputParams; successCount; tickDelay; trackOutput; version; auto; conditionMet; powered; load() { if (!this.rootTag) { return; } let tag = this.rootTag.find("Command"); if (tag) { this.command = tag.valueAsString; } tag = this.rootTag.find("CustomName"); if (tag) { this.customName = tag.valueAsString; } tag = this.rootTag.find("ExecuteOnFirstTick"); if (tag) { this.executeOnFirstTick = tag.valueAsBoolean; } tag = this.rootTag.find("LPCommandMode"); if (tag) { this.lpCommandMode = tag.valueAsInt; } tag = this.rootTag.find("LPCondionalMode"); // re: condional, that's sic if (tag) { this.lpConditionalMode = tag.valueAsBoolean; } tag = this.rootTag.find("LPRedstoneMode"); if (tag) { this.lpRedstoneMode = tag.valueAsBoolean; } tag = this.rootTag.find("LastExecution"); if (tag) { this.lastExecution = tag.valueAsBigInt; } tag = this.rootTag.find("LastOutput"); if (tag) { this.lastOutput = tag.valueAsString; } tag = this.rootTag.find("LastOutputParams"); if (tag) { this.lastOutputParams = tag.valueAsStringArray; } tag = this.rootTag.find("SuccessCount"); if (tag) { this.successCount = tag.valueAsInt; } tag = this.rootTag.find("TickDelay"); if (tag) { this.tickDelay = tag.valueAsInt; } tag = this.rootTag.find("TrackOutput"); if (tag) { this.trackOutput = tag.valueAsBoolean; } tag = this.rootTag.find("Version"); if (tag) { this.version = tag.valueAsInt; } tag = this.rootTag.find("auto"); if (tag) { this.auto = tag.valueAsBoolean; } tag = this.rootTag.find("powered"); if (tag) { this.powered = tag.valueAsBoolean; } } } exports.default = CommandBlockActor;