mirror of
https://github.com/trafficlunar/blockmatic.git
synced 2026-06-27 22:24:12 +00:00
fix: convert id array to single string in block data
This commit is contained in:
parent
2500a00e21
commit
e5ee9c81a9
7 changed files with 447 additions and 452 deletions
|
|
@ -28,10 +28,6 @@ const data = {};
|
|||
const pattern = new RegExp(nameRegex.join("|"), "g");
|
||||
const blockName = fileName.replace(pattern, "");
|
||||
|
||||
function getDataBlockProperty(property) {
|
||||
return VERSION_DATA.blocksByName[blockName] ? VERSION_DATA.blocksByName[blockName][property] : "REPLACE_ME_REPLACE_ME_REPLACE_ME_REPLACE_ME";
|
||||
}
|
||||
|
||||
function getVersion() {
|
||||
for (const key of Object.keys(versionRegex)) {
|
||||
if (blockName.includes(key)) {
|
||||
|
|
@ -44,7 +40,7 @@ const data = {};
|
|||
data[fileName] = {
|
||||
name: VERSION_DATA.blocksByName[fileName] ? VERSION_DATA.blocksByName[fileName].displayName : "REPLACE_ME_REPLACE_ME_REPLACE_ME_REPLACE_ME",
|
||||
version: getVersion(),
|
||||
id: [getDataBlockProperty("name"), getDataBlockProperty("id")],
|
||||
id: VERSION_DATA.blocksByName[blockName] ? VERSION_DATA.blocksByName[blockName][property] : "REPLACE_ME_REPLACE_ME_REPLACE_ME_REPLACE_ME",
|
||||
color: [color.value[0], color.value[1], color.value[2], color.value[3]],
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue