aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-18 15:35:31 +0000
committermat <github@matdoes.dev>2022-05-18 15:35:31 +0000
commit9defd9b01b3c733c2e423f32e92c748d70765c87 (patch)
tree90df15f0e7423501d42ed2400251404e856fbea6 /src/cleaners
parent21be335df3ad9f9f9008cd7138866234c922ca7d (diff)
downloadskyblock-api-9defd9b01b3c733c2e423f32e92c748d70765c87.tar.gz
skyblock-api-9defd9b01b3c733c2e423f32e92c748d70765c87.tar.bz2
skyblock-api-9defd9b01b3c733c2e423f32e92c748d70765c87.zip
split pets into their own auction items
Diffstat (limited to 'src/cleaners')
-rw-r--r--src/cleaners/skyblock/inventory.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cleaners/skyblock/inventory.ts b/src/cleaners/skyblock/inventory.ts
index df30be3..b5c85e2 100644
--- a/src/cleaners/skyblock/inventory.ts
+++ b/src/cleaners/skyblock/inventory.ts
@@ -21,6 +21,9 @@ export interface Item {
anvilUses?: number
timestamp?: string
enchantments?: { [name: string]: number }
+ petInfo?: {
+ id: string
+ }
headTexture?: string
}
@@ -54,6 +57,7 @@ function cleanItem(rawItem): Item | null {
headId = headIdFromBase64(headDataBase64)
}
+
return {
id: extraAttributes?.id ?? null,
count: itemCount ?? 1,
@@ -70,6 +74,9 @@ function cleanItem(rawItem): Item | null {
enchantments: extraAttributes?.enchantments,
anvilUses: extraAttributes?.anvil_uses,
timestamp: extraAttributes?.timestamp,
+ petInfo: extraAttributes?.petInfo ? {
+ id: JSON.parse(extraAttributes.petInfo).type
+ } : undefined,
headTexture: headId,
}