Show item textures for loot table entries

This commit is contained in:
Misode
2022-06-01 03:06:49 +02:00
parent 7e54c0f4f3
commit 986cca9191
4 changed files with 40 additions and 5 deletions

View File

@@ -154,6 +154,11 @@ export async function fetchVersions(): Promise<VersionMeta[]> {
}
}
export function getTextureUrl(versionId: VersionId, path: string): string {
const version = config.versions.find(v => v.id === versionId)!
return `${mcmeta(version, 'assets')}/assets/minecraft/textures/${path}.png`
}
async function getData<T = any>(url: string, fn: (v: any) => T = (v: any) => v): Promise<T> {
try {
const cache = await caches.open(CACHE_NAME)