Skip to content

Commit

Permalink
Fixed the simple setting of blocks with states
Browse files Browse the repository at this point in the history
  • Loading branch information
SIsilicon committed Mar 3, 2024
1 parent 4062733 commit f826c11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/modules/block_parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit f826c11

Please sign in to comment.