diff --git a/package.json b/package.json index 559a229..75bb987 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "growtopia.js", - "version": "1.3.1", + "version": "1.3.2", "description": "A package to create a growtopia private servers.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/structures/ItemsDat.ts b/src/structures/ItemsDat.ts index 7da97c7..6fe53c3 100644 --- a/src/structures/ItemsDat.ts +++ b/src/structures/ItemsDat.ts @@ -374,6 +374,10 @@ class ItemsDat { this.mempos += 25; item.extraTexture = await this.readString({ id: item.id }); } + + if (meta.version! >= 16) { + item.itemRenderer = await this.readString({ id: item.id }); + } } meta.items.push(item); diff --git a/test/items-builder-v16/index.js b/test/items-builder-v16/index.js new file mode 100644 index 0000000..f9ddda6 --- /dev/null +++ b/test/items-builder-v16/index.js @@ -0,0 +1,14 @@ +const fs = require("fs"); +const { ItemsDat } = require("../../dist"); + +const file = fs.readFileSync("./test/items-builder-v16/items.dat"); + +const item = new ItemsDat(file); + +(async () => { + const decoded = await item.decode(); + + decoded.items.forEach((i) => { + i.itemRenderer.length ? console.log(i) : undefined; + }); +})(); diff --git a/test/items-builder-v16/items.dat b/test/items-builder-v16/items.dat new file mode 100644 index 0000000..b68f74e Binary files /dev/null and b/test/items-builder-v16/items.dat differ diff --git a/types/items.d.ts b/types/items.d.ts index 7fbe19d..aefa5da 100644 --- a/types/items.d.ts +++ b/types/items.d.ts @@ -56,6 +56,7 @@ export interface ItemDefinition { bodyPart?: Buffer; flags5?: number; extraTexture?: string; + itemRenderer?: string; } export interface ItemsDatMeta {