@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
44 lines (42 loc) • 1.6 kB
JavaScript
;
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
const BlockActor_1 = require("./BlockActor");
class FrameBlockActor extends BlockActor_1.default {
load() {
if (!this.rootTag) {
return;
}
let tag = this.rootTag.find("ItemDropChance");
if (tag) {
this.itemDropChance = tag.valueAsFloat;
}
tag = this.rootTag.find("ItemRotation");
if (tag) {
this.itemRotation = tag.valueAsFloat;
}
tag = this.rootTag.find("Item");
if (tag !== null) {
const children = tag.getTagChildren();
for (let i = 0; i < children.length; i++) {
const childTag = children[i];
const countTag = childTag.find("Count");
const damageTag = childTag.find("Damage");
const nameTag = childTag.find("Name");
const wasPickedUpTag = childTag.find("WasPickedUp");
if (countTag && damageTag && nameTag && wasPickedUpTag) {
this.item = {
count: countTag.valueAsInt,
damage: damageTag.valueAsInt,
name: nameTag.valueAsString,
wasPickedUp: wasPickedUpTag.valueAsBoolean,
};
}
}
}
// add Item parsing here.
}
}
exports.default = FrameBlockActor;
//# sourceMappingURL=../../maps/minecraft/blockActors/FrameBlockActor.js.map