From 713f35b2dcb033898ecf1477b6d2cf895d37aac3 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 1 Jul 2022 00:40:33 -0500 Subject: Fix item heads --- src/lib/minecraft/Inventory.svelte | 2 +- src/lib/minecraft/Item.svelte | 3 +-- src/lib/minecraft/inventory.ts | 8 +++----- src/routes/auctionprices.svelte | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/lib/minecraft/Inventory.svelte b/src/lib/minecraft/Inventory.svelte index b01f27b..b3c464d 100644 --- a/src/lib/minecraft/Inventory.svelte +++ b/src/lib/minecraft/Inventory.svelte @@ -26,7 +26,7 @@
{#each itemGroups as itemGroup} {#each itemGroup as item} - + {/each} {/each}
diff --git a/src/lib/minecraft/Item.svelte b/src/lib/minecraft/Item.svelte index 5abf5bc..d48b080 100644 --- a/src/lib/minecraft/Item.svelte +++ b/src/lib/minecraft/Item.svelte @@ -7,7 +7,6 @@ export let item: any | null export let isslot = true export let pack: MatcherFile | undefined = undefined - export let headSize: number | undefined = undefined let itemLoreHtml: string | null let itemNameHtml: string | null @@ -43,7 +42,7 @@ itemNameHtml = itemDisplayName ? formattingCodeToHtml(itemDisplayName) : null } - $: imageUrl = item ? itemToUrl(item, pack, headSize) : null + $: imageUrl = item ? itemToUrl(item, pack) : null {#if item} diff --git a/src/lib/minecraft/inventory.ts b/src/lib/minecraft/inventory.ts index 9599c35..42ce6a7 100644 --- a/src/lib/minecraft/inventory.ts +++ b/src/lib/minecraft/inventory.ts @@ -104,7 +104,7 @@ let itemUrlCache: Record = {} setInterval(() => { itemUrlCache = {} }, 120 * 1000) -export function itemToUrl(item: Item, pack?: skyblockAssets.MatcherFile, headSize?: number): string { +export function itemToUrl(item: Item, pack?: skyblockAssets.MatcherFile): string { const itemNbt: skyblockAssets.NBT = { display: { Name: item.display?.name @@ -129,8 +129,6 @@ export function itemToUrl(item: Item, pack?: skyblockAssets.MatcherFile, headSiz }) if (textureUrl === null) { textureUrl = `https://h.matdoes.dev/3d/${item.headTexture}` - if (headSize) - textureUrl += `/${headSize}` } } else { textureUrl = skyblockAssets.getTextureUrl({ @@ -143,9 +141,9 @@ export function itemToUrl(item: Item, pack?: skyblockAssets.MatcherFile, headSiz return textureUrl } -export function skyblockItemToUrl(skyblockItem: string | Item, pack?: skyblockAssets.MatcherFile, headSize?: number) { +export function skyblockItemToUrl(skyblockItem: string | Item, pack?: skyblockAssets.MatcherFile) { const item = typeof skyblockItem === 'string' ? skyblockItemNameToItem(skyblockItem) : skyblockItem - const itemTextureUrl = itemToUrl(item, pack, headSize) + const itemTextureUrl = itemToUrl(item, pack) return itemTextureUrl } diff --git a/src/routes/auctionprices.svelte b/src/routes/auctionprices.svelte index ac75c86..8093a30 100644 --- a/src/routes/auctionprices.svelte +++ b/src/routes/auctionprices.svelte @@ -121,7 +121,7 @@
{#if itemData && itemData.vanillaId}
- +
{/if}

-- cgit