mirror of
https://github.com/trafficlunar/blockmatic.git
synced 2026-06-28 14:44:12 +00:00
fix: add block properties
This commit is contained in:
parent
41ab349e43
commit
ab3d36257e
2 changed files with 90 additions and 39 deletions
|
|
@ -43,18 +43,21 @@ function SaveLitematic({ close }: DialogProps) {
|
|||
// Generate the block pallete
|
||||
const blockStatePallete = [
|
||||
{ Name: "minecraft:air" },
|
||||
...Array.from(new Set(blocks.map((block) => `minecraft:${block.name}`))).map((name) => {
|
||||
const blockInfo = blockData[name.replace("minecraft:", "")];
|
||||
...Array.from(
|
||||
new Set(
|
||||
blocks.map((block) => {
|
||||
const blockInfo = blockData[block.name.replace("minecraft:", "")];
|
||||
|
||||
const returnData: { Name: string; Properties?: Record<string, string> } = {
|
||||
Name: name,
|
||||
};
|
||||
const returnData: { Name: string; Properties?: Record<string, string> } = {
|
||||
Name: `minecraft:${blockInfo.id[0]}`,
|
||||
};
|
||||
|
||||
if (blockInfo.id) returnData["Name"] = `minecraft:${blockInfo.id[0]}`;
|
||||
if (blockInfo.properties) returnData["Properties"] = blockInfo.properties;
|
||||
if (blockInfo.properties) returnData["Properties"] = blockInfo.properties;
|
||||
|
||||
return returnData;
|
||||
}),
|
||||
return returnData;
|
||||
})
|
||||
)
|
||||
),
|
||||
];
|
||||
|
||||
// Get the block states
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue