Minecraft-Recipe-Tools/extract_recipes.txt

15 lines
662 B
Plaintext
Raw Permalink Normal View History

2024-12-10 01:49:42 +08:00
按照此伪代码编写一个Node.js脚本要求
1. 尽量不使用第三方库adm-zip 除外用来解析jar包
2. 使用双引号代替单引号
3. 使用引号
伪代码:
如果 ./recipes 不存在,则创建 ./recipes 文件夹
如果 ./recipes/pack.mcmeta 不存在,则创建并写入格式化的 { "pack": { "description": "通用了部分整合包模组的物品", "pack_format": 9 } }
遍历读取 ./mods 下的所有 *.jar {
const dirList = 读取 *.jar 内部的 /data 文件夹里的子文件夹目录;
遍历 dirList {
解压 *.jar 内部的 `/data/${dir}/recipes` 至 `./data/${dir}/recipes`
}
}