diff options
author | mat <github@matdoes.dev> | 2022-03-26 13:17:48 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-03-26 13:17:48 -0500 |
commit | 03537cf0cce0a19740c069c700374cafe176b3b5 (patch) | |
tree | 9ce3bd8911c04f8670b6baf504304763cd91325b /src/cleaners/skyblock/inventory.ts | |
parent | 6b94d0110a52a355758432ff6cd14c80553471ea (diff) | |
download | skyblock-api-03537cf0cce0a19740c069c700374cafe176b3b5.tar.gz skyblock-api-03537cf0cce0a19740c069c700374cafe176b3b5.tar.bz2 skyblock-api-03537cf0cce0a19740c069c700374cafe176b3b5.zip |
Change a lot of things to use typed-hypixel-api
Diffstat (limited to 'src/cleaners/skyblock/inventory.ts')
-rw-r--r-- | src/cleaners/skyblock/inventory.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cleaners/skyblock/inventory.ts b/src/cleaners/skyblock/inventory.ts index 0ebb581..9e5ee29 100644 --- a/src/cleaners/skyblock/inventory.ts +++ b/src/cleaners/skyblock/inventory.ts @@ -1,6 +1,7 @@ -// maybe todo?: create a fast replacement for prismarine-nbt +import typedHypixelApi from 'typed-hypixel-api' import * as nbt from 'prismarine-nbt' + function base64decode(base64: string): Buffer { return Buffer.from(base64, 'base64') } @@ -19,7 +20,7 @@ interface Item { reforge?: string anvilUses?: number timestamp?: string - enchantments?: { [ name: string ]: number } + enchantments?: { [name: string]: number } headTexture?: string } @@ -98,9 +99,9 @@ export const INVENTORIES = { personal_vault: 'personal_vault_contents' } -export type Inventories = { [name in keyof typeof INVENTORIES ]: Item[] } +export type Inventories = { [name in keyof typeof INVENTORIES]: Item[] } -export async function cleanInventories(data: any): Promise<Inventories> { +export async function cleanInventories(data: typedHypixelApi.SkyBlockProfileMember): Promise<Inventories> { const cleanInventories: any = {} for (const cleanInventoryName in INVENTORIES) { const hypixelInventoryName = INVENTORIES[cleanInventoryName] |