"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
const BlockActor_1 = require("./BlockActor");
class CauldronBlockActor extends BlockActor_1.default {
    constructor() {
        super(...arguments);
        this.items = [];
    }
    load() {
        if (!this.rootTag) {
            return;
        }
        let tag = this.rootTag.find("PotionId");
        if (tag) {
            this.potionId = tag.valueAsInt;
        }
        tag = this.rootTag.find("PotionType");
        if (tag) {
            this.potionType = tag.valueAsInt;
        }
        tag = this.rootTag.find("Items");
        if (tag !== null) {
            const children = tag.getTagChildren();
            this.items = [];
            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 slotTag = childTag.find("Slot");
                const wasPickedUpTag = childTag.find("WasPickedUp");
                if (countTag && damageTag && nameTag && slotTag && wasPickedUpTag) {
                    this.items.push({
                        count: countTag.valueAsInt,
                        damage: damageTag.valueAsInt,
                        name: nameTag.valueAsString,
                        slot: slotTag.valueAsInt,
                        wasPickedUp: wasPickedUpTag.valueAsBoolean,
                    });
                }
            }
        }
    }
}
exports.default = CauldronBlockActor;

//# sourceMappingURL=../../maps/minecraft/blockActors/CauldronBlockActor.js.map
