Skip to content

Commit

Permalink
fix invalid buffer size when writing items
Browse files Browse the repository at this point in the history
  • Loading branch information
JadlionHD committed Dec 27, 2023
1 parent a8332d9 commit b568ca2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/structures/ItemsDat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ItemsDat {
* @param items An array of items
*/
private getWriteSize(items: ItemDefinition[]) {
let size = 194 * items.length;
let size = 196 * items.length;
// get sizes for the string
for (const item of items) {
const keys = Object.keys(item);
Expand Down
3 changes: 3 additions & 0 deletions test/items-builder-v16/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ const item = new ItemsDat(file);
decoded.items.forEach((i) => {
i.itemRenderer.length ? console.log(i) : undefined;
});

const encoded = await item.encode(decoded);
console.log({ encoded });
})();

0 comments on commit b568ca2

Please sign in to comment.