From f826c113b07c2608aefb6f14a7647e3f6d73e49b Mon Sep 17 00:00:00 2001 From: SIsilicon Date: Sun, 3 Mar 2024 18:30:28 -0500 Subject: [PATCH] Fixed the simple setting of blocks with states --- src/server/modules/block_parsing.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/modules/block_parsing.ts b/src/server/modules/block_parsing.ts index 25e9952c9..34a917b2e 100644 --- a/src/server/modules/block_parsing.ts +++ b/src/server/modules/block_parsing.ts @@ -134,9 +134,9 @@ export function parsedBlock2BlockPermutation(block: parsedBlock) { export function parsedBlock2CommandArg(block: parsedBlock) { let id = block.id; if (id.startsWith("minecraft:")) id = id.slice("minecraft:".length); - const states = Object.entries(block.states ?? {}); - if (states.length) { - id += `[${states + const states = block.states; + if (states?.size) { + id += `[${Array.from(states.entries()) .map(([key, value]) => { value = typeof value === "string" ? `"${value}"` : value; return `"${key}"=${value}`;