From 26fb017d2d83f839899b8396edde410a79939f1d Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Tue, 7 Jan 2025 19:40:11 +0000 Subject: [PATCH] fix: remove duplicate blocks in pallete in litematic export --- src/components/dialogs/SaveLitematic.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/dialogs/SaveLitematic.tsx b/src/components/dialogs/SaveLitematic.tsx index db9e9c2..cdbfb9f 100644 --- a/src/components/dialogs/SaveLitematic.tsx +++ b/src/components/dialogs/SaveLitematic.tsx @@ -50,14 +50,14 @@ function SaveLitematic({ close }: DialogProps) { const returnData: { Name: string; Properties?: Record } = { Name: `minecraft:${blockInfo.id[0]}`, + ...(blockInfo.properties ? { Properties: blockInfo.properties } : {}), }; - if (blockInfo.properties) returnData["Properties"] = blockInfo.properties; - - return returnData; + // Stringify to remove duplicates + return JSON.stringify(returnData); }) ) - ), + ).map((serialized) => JSON.parse(serialized)), ]; // Get the block states