Skip to content

Commit

Permalink
batch exporter bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanhowell5195 committed Sep 3, 2024
1 parent 6bdeebe commit 55d6ffe
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
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.5.1",
"min_version": "4.10.0",
"variant": "desktop",
"website": "https://ewanhowell.com/plugins/resource-pack-utilities/",
Expand Down
14 changes: 14 additions & 0 deletions plugins/resource_pack_utilities/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,19 @@
]
}
]
},
"1.5.1": {
"title": "1.5.1",
"date": "2024-09-03",
"author": "Ewan Howell",
"categories": [
{
"title": "Bug Fixes",
"list": [
"Fixed Batch Exporter failing to parse certain bbmodel files",
"Fixed Batch Exporter failing to export formats where the codec ID did not match the format ID"
]
}
]
}
}
12 changes: 5 additions & 7 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.5.1",
min_version: "4.10.0",
variant: "desktop",
website: `https://ewanhowell.com/plugins/${id.replace(/_/g, "-")}/`,
Expand Down Expand Up @@ -3298,11 +3298,11 @@
}

let exportOptions = {}
if (Object.keys(Codecs[this.format].export_options).length) {
if (Object.keys(Formats[this.format].codec.export_options).length) {
output.log("Getting export options…")
newProject("")
await Codecs[this.format].promptExportOptions()
exportOptions = Codecs[this.format].getExportOptions()
exportOptions = Formats[this.format].codec.getExportOptions()
await Project.close()
output.log("Export options loaded")
}
Expand All @@ -3321,10 +3321,8 @@
this.done++
continue
}
let data
try {
data = JSON.parse(await fs.promises.readFile(path.join(this.inputFolder, file)))
} catch {
const data = autoParseJSON(await fs.promises.readFile(path.join(this.inputFolder, file), "utf-8"), false)
if (!data) {
output.error(`Skipping \`${file}\` as it could not be read`)
this.done++
continue
Expand Down

0 comments on commit 55d6ffe

Please sign in to comment.