UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

36 lines (34 loc) 1.16 kB
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); class AttributeComponent { loadFromNbtTag(tag) { const minTag = tag.find("Min"); if (minTag !== null) { this.minimum = minTag.valueAsFloat; } const maxTag = tag.find("Max"); if (maxTag !== null) { this.maximum = maxTag.valueAsFloat; } let dminTag = tag.find("DefaultMin"); if (dminTag !== null) { this.defaultMinimum = dminTag.valueAsFloat; } const dmaxTag = tag.find("DefaultMax"); if (dmaxTag !== null) { this.defaultMaximum = dmaxTag.valueAsFloat; } const baseTag = tag.find("Base"); if (baseTag !== null) { this.base = baseTag.valueAsFloat; } const currentTag = tag.find("Current"); if (currentTag !== null) { this.current = currentTag.valueAsFloat; } } } exports.default = AttributeComponent; //# sourceMappingURL=../../maps/minecraft/components/FloatAttributeComponent.js.map