mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-29 01:22:44 +00:00
Add equipment generator
This commit is contained in:
@@ -5,7 +5,6 @@ export interface ConfigLanguage {
|
||||
code: string,
|
||||
name: string,
|
||||
mc: string,
|
||||
schemas?: boolean,
|
||||
}
|
||||
|
||||
export interface ConfigVersion {
|
||||
|
||||
@@ -137,7 +137,7 @@ export async function fetchPreset(versionId: VersionId, registry: string, id: st
|
||||
if (id.startsWith('immersive_weathering:')) {
|
||||
url = `https://raw.githubusercontent.com/AstralOrdana/Immersive-Weathering/main/src/main/resources/data/immersive_weathering/block_growths/${id.slice(21)}.json`
|
||||
} else {
|
||||
const type = ['atlases', 'blockstates', 'items', 'font', 'lang', 'models', 'post_effect'].includes(registry) ? 'assets' : 'data'
|
||||
const type = ['atlases', 'blockstates', 'items', 'font', 'lang', 'models', 'equipment', 'post_effect'].includes(registry) ? 'assets' : 'data'
|
||||
url = `${mcmeta(version, type)}/${type}/minecraft/${registry}/${id}.json`
|
||||
}
|
||||
const res = await fetch(url)
|
||||
@@ -152,7 +152,7 @@ export async function fetchAllPresets(versionId: VersionId, registry: string) {
|
||||
const version = config.versions.find(v => v.id === versionId)!
|
||||
await validateCache(version)
|
||||
try {
|
||||
const type = ['atlas', 'block_definition', 'item_definition', 'model', 'font'].includes(registry) ? 'assets' : 'data'
|
||||
const type = ['atlas', 'block_definition', 'item_definition', 'model', 'font', 'lang', 'equipment', 'post_effect'].includes(registry) ? 'assets' : 'data'
|
||||
return new Map<string, unknown>(Object.entries(await cachedFetch(`${mcmeta(version, 'summary')}/${type}/${registry}/data.min.json`)))
|
||||
} catch (e) {
|
||||
throw new Error(`Error occurred while fetching all ${registry} presets: ${message(e)}`)
|
||||
|
||||
Reference in New Issue
Block a user