Skip to content

Commit e088b13

Browse files
committed
Add texture .png.mcmeta generator (FIXED)
1 parent 3d7b0ab commit e088b13

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

src/app/Config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export interface ConfigGenerator {
2020
id: string,
2121
url: string,
2222
path?: string,
23+
ext?: string,
2324
noPath?: boolean,
2425
tags?: string[],
2526
aliases?: string[],

src/app/components/generator/FileCreation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function FileCreation({ docAndNode, gen, method }: Props) {
4545
const projectRoot = getProjectRoot(project)
4646
const uri = gen.id === 'pack_mcmeta'
4747
? `${projectRoot}pack.mcmeta`
48-
: `${projectRoot}${pack}/${id.namespace}/${genPath(gen, version)}/${id.path}.json`
48+
: `${projectRoot}${pack}/${id.namespace}/${genPath(gen, version)}/${id.path}${gen.ext ?? '.json'}`
4949
Analytics.saveProjectFile(method)
5050
const text = docAndNode.doc.getText()
5151
client.fs.writeFile(uri, text).then(() => {

src/app/contexts/Project.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function ProjectProvider({ children }: { children: ComponentChildren }) {
9595
const { namespace, path } = Identifier.parse(file.id)
9696
const uri = type === 'pack_mcmeta'
9797
? `${projectRoot}data/pack.mcmeta`
98-
: `${projectRoot}data/${namespace}/${type}/${path}.json`
98+
: `${projectRoot}data/${namespace}/${type}/${path}${gen.ext ?? '.json'}`
9999
return SpyglassClient.FS.writeFile(uri, JSON.stringify(file.data, null, 2))
100100
}))
101101
}

src/app/services/Spyglass.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export class SpyglassService {
257257
return `${UNSAVED_URI}pack.mcmeta`
258258
}
259259
const pack = gen.tags?.includes('assets') ? 'assets' : 'data'
260-
return `${UNSAVED_URI}${pack}/draft/${genPath(gen, this.version)}/draft.json`
260+
return `${UNSAVED_URI}${pack}/draft/${genPath(gen, this.version)}/draft${gen.ext ?? '.json'}`
261261
}
262262

263263
public watchFile(uri: string, handler: (docAndNode: core.DocAndNode) => void) {

src/config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,14 @@
631631
"tags": ["assets"],
632632
"wiki": "https://minecraft.wiki/w/Model#Item_models"
633633
},
634+
{
635+
"id": "texture_meta",
636+
"url": "assets/texture-meta",
637+
"path": "textures",
638+
"ext": ".png.mcmeta",
639+
"tags": ["assets"],
640+
"wiki": "https://minecraft.wiki/w/Resource_pack#Texture_animation"
641+
},
634642
{
635643
"id": "equipment",
636644
"url": "assets/equipment",

src/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"generator.lang": "Language",
9090
"generator.loot_table": "Loot Table",
9191
"generator.model": "Model",
92+
"generator.texture_meta": "Texture Metadata",
9293
"generator.neoforge:biome_modifier": "Biome Modifier",
9394
"generator.neoforge:data_map_compostables": "Compostables Data Map",
9495
"generator.neoforge:data_map_furnace_fuels": "Furnace Fuels Data Map",

0 commit comments

Comments
 (0)