diff --git a/README.md b/README.md new file mode 100644 index 0000000..06f223a --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Pack Converter +## Progress: +### Currently working: +- Extract *some* 1.8 resource packs and rename blocks and items to their correct 1.20 names. +- Change format in pack.mcmeta +### Need to work on: +- Fixing textures + - Clock + - Compass + - Potion +- Fix "EISDIR" error with certain resource packs. (Prism as an example) +- Decide what to do with particles, as particles are split into separate files in 1.20. +- Implement a way to duplicate a texture and rename them to separate names (dye_powder_white -> bone_meal + white_dye) etc. \ No newline at end of file diff --git a/index.js b/index.js index 151992f..6290ac9 100644 --- a/index.js +++ b/index.js @@ -13,26 +13,24 @@ jsonfile.readFile(itemRemaps, function (err, obj) { if (err) console.error(err); items = obj; }); +let toConvertName; -/* -TODO: -Textures to check in the future: -- Clock -- Compass -- Filled Map -- Potion -Fix "EISDIR" error. -*/ - -extract('1.8'); -extract('3Stimpy_War_Remake_v2'); -// extract('! §fp§2ri§3sm §8[§f16§3x§8]'); for some reason prism errors??? +try { + toConvertName = process.argv[2]; + if (fs.existsSync(`input/${toConvertName}.zip`)) { + convert(toConvertName); + } else { + console.log('Usage: npm start '); + } +} catch (err) { + console.log(err); +} /** * @param {string} input Name of resource pack zip file */ -function extract(input) { +function convert(input) { const extractedPath = `out/${input}/assets/minecraft/textures/`; decompress(`input/${input}.zip`, `out/${input}`).then(files => { files.forEach(element => { @@ -59,7 +57,7 @@ function extract(input) { if (rename) { try { fs.renameSync(`${path1}${name}.${extension}`, `${path1}${rename}.${extension}`); - console.log(`Renamed ${path1}${name}.${extension} to ${path1}${rename}.${extension}`); + console.log(`Renamed ${name}.${extension} to ${rename}.${extension}`); } catch (error) { console.log(error); }