aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-07-01 15:00:08 -0500
committermat <github@matdoes.dev>2022-07-01 15:00:08 -0500
commit539f43809c0b108f54defd8396237f4feaca274e (patch)
treef4ba38fbefdf43531006bdbee2aa50abec6c9a0a /src
parent0358ff2db613a494b377a33b55eb798d44dba6c2 (diff)
downloadskyblock-stats-539f43809c0b108f54defd8396237f4feaca274e.tar.gz
skyblock-stats-539f43809c0b108f54defd8396237f4feaca274e.tar.bz2
skyblock-stats-539f43809c0b108f54defd8396237f4feaca274e.zip
Revert "Merge branch 'faster-heads'"
This reverts commit 0358ff2db613a494b377a33b55eb798d44dba6c2, reversing changes made to dc95635f199e86072ad7fa7fc7a5d77457120715.
Diffstat (limited to 'src')
-rw-r--r--src/lib/minecraft/Inventory.svelte2
-rw-r--r--src/lib/minecraft/Item.svelte3
-rw-r--r--src/lib/minecraft/inventory.ts8
-rw-r--r--src/routes/auctionprices.svelte2
4 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/minecraft/Inventory.svelte b/src/lib/minecraft/Inventory.svelte
index b3c464d..b01f27b 100644
--- a/src/lib/minecraft/Inventory.svelte
+++ b/src/lib/minecraft/Inventory.svelte
@@ -26,7 +26,7 @@
<div class="inventory-container" style="--group-limit:{groupLimit}">
{#each itemGroups as itemGroup}
{#each itemGroup as item}
- <Item {item} {pack} isslot />
+ <Item {item} {pack} headSize={50} isslot />
{/each}
{/each}
</div>
diff --git a/src/lib/minecraft/Item.svelte b/src/lib/minecraft/Item.svelte
index d48b080..5abf5bc 100644
--- a/src/lib/minecraft/Item.svelte
+++ b/src/lib/minecraft/Item.svelte
@@ -7,6 +7,7 @@
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
@@ -42,7 +43,7 @@
itemNameHtml = itemDisplayName ? formattingCodeToHtml(itemDisplayName) : null
}
- $: imageUrl = item ? itemToUrl(item, pack) : null
+ $: imageUrl = item ? itemToUrl(item, pack, headSize) : null
</script>
{#if item}
diff --git a/src/lib/minecraft/inventory.ts b/src/lib/minecraft/inventory.ts
index 42ce6a7..9599c35 100644
--- a/src/lib/minecraft/inventory.ts
+++ b/src/lib/minecraft/inventory.ts
@@ -104,7 +104,7 @@ let itemUrlCache: Record<string, string> = {}
setInterval(() => {
itemUrlCache = {}
}, 120 * 1000)
-export function itemToUrl(item: Item, pack?: skyblockAssets.MatcherFile): string {
+export function itemToUrl(item: Item, pack?: skyblockAssets.MatcherFile, headSize?: number): string {
const itemNbt: skyblockAssets.NBT = {
display: {
Name: item.display?.name
@@ -129,6 +129,8 @@ export function itemToUrl(item: Item, pack?: skyblockAssets.MatcherFile): string
})
if (textureUrl === null) {
textureUrl = `https://h.matdoes.dev/3d/${item.headTexture}`
+ if (headSize)
+ textureUrl += `/${headSize}`
}
} else {
textureUrl = skyblockAssets.getTextureUrl({
@@ -141,9 +143,9 @@ export function itemToUrl(item: Item, pack?: skyblockAssets.MatcherFile): string
return textureUrl
}
-export function skyblockItemToUrl(skyblockItem: string | Item, pack?: skyblockAssets.MatcherFile) {
+export function skyblockItemToUrl(skyblockItem: string | Item, pack?: skyblockAssets.MatcherFile, headSize?: number) {
const item = typeof skyblockItem === 'string' ? skyblockItemNameToItem(skyblockItem) : skyblockItem
- const itemTextureUrl = itemToUrl(item, pack)
+ const itemTextureUrl = itemToUrl(item, pack, headSize)
return itemTextureUrl
}
diff --git a/src/routes/auctionprices.svelte b/src/routes/auctionprices.svelte
index 8093a30..ac75c86 100644
--- a/src/routes/auctionprices.svelte
+++ b/src/routes/auctionprices.svelte
@@ -121,7 +121,7 @@
<div class="item-container">
{#if itemData && itemData.vanillaId}
<div class="item-slot-container">
- <Item item={{ ...itemData, id: item.id }} pack={furfskyReborn} isslot />
+ <Item item={{ ...itemData, id: item.id }} pack={furfskyReborn} headSize={50} isslot />
</div>
{/if}
<h2>