diff --git a/src/app/Config.ts b/src/app/Config.ts index 77dc2627..3633288c 100644 --- a/src/app/Config.ts +++ b/src/app/Config.ts @@ -20,6 +20,7 @@ export interface ConfigGenerator { id: string, url: string, path?: string, + ext?: string, noPath?: boolean, tags?: string[], aliases?: string[], diff --git a/src/app/components/generator/FileCreation.tsx b/src/app/components/generator/FileCreation.tsx index 1f159753..ef8b6901 100644 --- a/src/app/components/generator/FileCreation.tsx +++ b/src/app/components/generator/FileCreation.tsx @@ -45,7 +45,7 @@ export function FileCreation({ docAndNode, gen, method }: Props) { const projectRoot = getProjectRoot(project) const uri = gen.id === 'pack_mcmeta' ? `${projectRoot}pack.mcmeta` - : `${projectRoot}${pack}/${id.namespace}/${genPath(gen, version)}/${id.path}.json` + : `${projectRoot}${pack}/${id.namespace}/${genPath(gen, version)}/${id.path}${gen.ext ?? '.json'}` Analytics.saveProjectFile(method) const text = docAndNode.doc.getText() client.fs.writeFile(uri, text).then(() => { diff --git a/src/app/contexts/Project.tsx b/src/app/contexts/Project.tsx index c3e6a6b6..c166ccf8 100644 --- a/src/app/contexts/Project.tsx +++ b/src/app/contexts/Project.tsx @@ -95,7 +95,7 @@ export function ProjectProvider({ children }: { children: ComponentChildren }) { const { namespace, path } = Identifier.parse(file.id) const uri = type === 'pack_mcmeta' ? `${projectRoot}data/pack.mcmeta` - : `${projectRoot}data/${namespace}/${type}/${path}.json` + : `${projectRoot}data/${namespace}/${type}/${path}${gen.ext ?? '.json'}` return SpyglassClient.FS.writeFile(uri, JSON.stringify(file.data, null, 2)) })) } diff --git a/src/app/services/Spyglass.ts b/src/app/services/Spyglass.ts index d6b3e5d5..814a7d0b 100644 --- a/src/app/services/Spyglass.ts +++ b/src/app/services/Spyglass.ts @@ -257,7 +257,7 @@ export class SpyglassService { return `${UNSAVED_URI}pack.mcmeta` } const pack = gen.tags?.includes('assets') ? 'assets' : 'data' - return `${UNSAVED_URI}${pack}/draft/${genPath(gen, this.version)}/draft.json` + return `${UNSAVED_URI}${pack}/draft/${genPath(gen, this.version)}/draft${gen.ext}` } public watchFile(uri: string, handler: (docAndNode: core.DocAndNode) => void) { diff --git a/src/config.json b/src/config.json index 52138db8..31060668 100644 --- a/src/config.json +++ b/src/config.json @@ -626,6 +626,14 @@ "tags": ["assets"], "wiki": "https://minecraft.wiki/w/Model#Item_models" }, + { + "id": "texture_meta", + "url": "assets/texture-meta", + "path": "textures", + "ext": ".png.mcmeta", + "tags": ["assets"], + "wiki": "https://minecraft.wiki/w/Resource_pack#Texture_animation" + }, { "id": "equipment", "url": "assets/equipment", diff --git a/src/locales/en.json b/src/locales/en.json index 31d6c133..1d3b4ba9 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -89,6 +89,7 @@ "generator.lang": "Language", "generator.loot_table": "Loot Table", "generator.model": "Model", + "generator.texture_meta": "Texture Metadata", "generator.neoforge:biome_modifier": "Biome Modifier", "generator.neoforge:data_map_compostables": "Compostables Data Map", "generator.neoforge:data_map_furnace_fuels": "Furnace Fuels Data Map",