UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

50 lines (49 loc) 1.85 kB
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); exports.RotatableHorizontalBlockTrait = void 0; const ContentTraits_1 = require("./ContentTraits"); /** * Rotatable horizontal - can be placed in 4 directions. */ class RotatableHorizontalBlockTrait extends ContentTraits_1.BlockContentTrait { get id() { return "rotatable_horizontal"; } getData(_config) { return { id: "rotatable_horizontal", displayName: "Rotatable Horizontal", description: "Can be placed in 4 directions", category: "placement", components: { "minecraft:transformation": { rotation: [0, 0, 0], }, }, properties: { "custom:direction": [0, 1, 2, 3], }, permutations: [ { condition: "q.block_state('custom:direction') == 0", components: { "minecraft:transformation": { rotation: [0, 0, 0] } }, }, { condition: "q.block_state('custom:direction') == 1", components: { "minecraft:transformation": { rotation: [0, 90, 0] } }, }, { condition: "q.block_state('custom:direction') == 2", components: { "minecraft:transformation": { rotation: [0, 180, 0] } }, }, { condition: "q.block_state('custom:direction') == 3", components: { "minecraft:transformation": { rotation: [0, 270, 0] } }, }, ], }; } } exports.RotatableHorizontalBlockTrait = RotatableHorizontalBlockTrait;