UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

58 lines (57 loc) 2.24 kB
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); exports.RotatableAllBlockTrait = void 0; const ContentTraits_1 = require("./ContentTraits"); /** * Rotatable all - can be placed in 6 directions. */ class RotatableAllBlockTrait extends ContentTraits_1.BlockContentTrait { get id() { return "rotatable_all"; } getData(_config) { return { id: "rotatable_all", displayName: "Rotatable All", description: "Can be placed in 6 directions", category: "placement", components: { "minecraft:transformation": { rotation: [0, 0, 0], }, }, properties: { "custom:facing": ["up", "down", "north", "south", "east", "west"], }, permutations: [ { condition: "q.block_state('custom:facing') == 'up'", components: { "minecraft:transformation": { rotation: [0, 0, 0] } }, }, { condition: "q.block_state('custom:facing') == 'down'", components: { "minecraft:transformation": { rotation: [180, 0, 0] } }, }, { condition: "q.block_state('custom:facing') == 'north'", components: { "minecraft:transformation": { rotation: [90, 0, 0] } }, }, { condition: "q.block_state('custom:facing') == 'south'", components: { "minecraft:transformation": { rotation: [-90, 0, 0] } }, }, { condition: "q.block_state('custom:facing') == 'east'", components: { "minecraft:transformation": { rotation: [0, 0, -90] } }, }, { condition: "q.block_state('custom:facing') == 'west'", components: { "minecraft:transformation": { rotation: [0, 0, 90] } }, }, ], }; } } exports.RotatableAllBlockTrait = RotatableAllBlockTrait;