From 03537cf0cce0a19740c069c700374cafe176b3b5 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 26 Mar 2022 13:17:48 -0500 Subject: Change a lot of things to use typed-hypixel-api --- src/cleaners/skyblock/inventory.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/cleaners/skyblock/inventory.ts') 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 { +export async function cleanInventories(data: typedHypixelApi.SkyBlockProfileMember): Promise { const cleanInventories: any = {} for (const cleanInventoryName in INVENTORIES) { const hypixelInventoryName = INVENTORIES[cleanInventoryName] -- cgit