mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 07:10:41 +00:00
Add texture .png.mcmeta generator
This commit is contained in:
@@ -20,6 +20,7 @@ export interface ConfigGenerator {
|
||||
id: string,
|
||||
url: string,
|
||||
path?: string,
|
||||
ext?: string,
|
||||
noPath?: boolean,
|
||||
tags?: string[],
|
||||
aliases?: string[],
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -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))
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user