fix: remove duplicate blocks in pallete in litematic export

This commit is contained in:
trafficlunar 2025-01-07 19:40:11 +00:00
parent 9a8c74071a
commit 26fb017d2d

View file

@ -50,14 +50,14 @@ function SaveLitematic({ close }: DialogProps) {
const returnData: { Name: string; Properties?: Record<string, string> } = {
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