Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource Pack Utilities Plugin - Enhanced Bedrock BBModel Parsing in Batch Export Tool. #611

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
"author": "Ewan Howell",
"description": "A collection of utilities to assist with resource pack creation.",
"tags": ["Minecraft: Java Edition", "Resource Packs", "Utilities"],
"version": "1.5.0",
"version": "1.6.0",
"min_version": "4.10.0",
"variant": "desktop",
"website": "https://ewanhowell.com/plugins/resource-pack-utilities/",
Expand Down
15 changes: 14 additions & 1 deletion plugins/resource_pack_utilities/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,18 @@
]
}
]
},
"1.6.0": {
"title": "1.6.0",
"date": "2024-09-03",
"author": "Ewan Howell",
"categories": [
{
"title": "Bug Fixes",
"list": [
"Fixed an issue with the Batch Exporter failing to read BBModels in Bedrock format."
]
}
]
}
}
}
19 changes: 14 additions & 5 deletions plugins/resource_pack_utilities/resource_pack_utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
author: "Ewan Howell",
description,
tags: ["Minecraft: Java Edition", "Resource Packs", "Utilities"],
version: "1.5.0",
version: "1.6.0",
min_version: "4.10.0",
variant: "desktop",
website: `https://ewanhowell.com/plugins/${id.replace(/_/g, "-")}/`,
Expand Down Expand Up @@ -3325,9 +3325,18 @@
try {
data = JSON.parse(await fs.promises.readFile(path.join(this.inputFolder, file)))
} catch {
output.error(`Skipping \`${file}\` as it could not be read`)
this.done++
continue
try {
data = autoParseJSON(
await fs.promises.readFile(
path.join(this.inputFolder, file),
"utf-8"
)
);
} catch {
output.error(`Skipping \`${file}\` as it could not be read`)
this.done++
continue
}
}
if (data.meta.model_format !== this.format && !batchExporterSpecialFormats.includes(this.format)) {
output.warn(`Skipping \`${file}\` as it is in ${data.meta.model_format in Formats ? `the \`${Formats[data.meta.model_format].name}\`` : "an unknown"} format`)
Expand Down Expand Up @@ -4972,4 +4981,4 @@
globalThis.resourcePackUtilities = utilities

setupPlugin()
})()
})()
Loading