Update index.js and README.md

This commit is contained in:
2vb 2023-11-23 04:13:24 -08:00
parent 60708b0a9c
commit 4a81e95b46
2 changed files with 16 additions and 15 deletions

View File

@ -1,9 +1,10 @@
# Pack Converter # Pack Converter
## Progress: ## Progress:
### Currently working: ### Currently working:
- Extract *some* 1.8 resource packs and rename blocks and items to their correct 1.20 names. - Extract 1.8 resource packs and rename blocks and items to their correct 1.20 names.
- Change format in pack.mcmeta - Pack format change from 1 to 15 in pack.mcmeta
### Need to work on: ### Need to work on:
- Rezip pack when done.
- Fixing textures - Fixing textures
- Clock - Clock
- Compass - Compass

View File

@ -58,7 +58,7 @@ function convert(input) {
const path1 = `${extractedPath}${type}/`; const path1 = `${extractedPath}${type}/`;
if (rename) { if (rename) {
try { try {
// fs.renameSync(`${path1}${name}.${extension}`, `${path1}${rename}.${extension}`); fs.renameSync(`${path1}${name}.${extension}`, `${path1}${rename}.${extension}`);
console.log(`Renamed ${name}.${extension} to ${rename}.${extension}`); console.log(`Renamed ${name}.${extension} to ${rename}.${extension}`);
} catch (error) { } catch (error) {
console.log(error); console.log(error);
@ -67,26 +67,26 @@ function convert(input) {
}); });
}).then(() => { }).then(() => {
try { try {
// fs.renameSync(`${extractedPath}blocks`, `${extractedPath}block`); fs.renameSync(`${extractedPath}blocks`, `${extractedPath}block`);
console.log(`Renamed ${extractedPath}blocks to ${extractedPath}block`); console.log(`Renamed ${extractedPath}blocks to ${extractedPath}block`);
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
try { try {
// fs.renameSync(`${extractedPath}items`, `${extractedPath}item`); fs.renameSync(`${extractedPath}items`, `${extractedPath}item`);
console.log(`Renamed ${extractedPath}items to ${extractedPath}item`); console.log(`Renamed ${extractedPath}items to ${extractedPath}item`);
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
// jsonfile.readFile(`out/${input}/pack.mcmeta`, function (err, obj) { jsonfile.readFile(`out/${input}/pack.mcmeta`, function (err, obj) {
// if (err) console.error(err); if (err) console.error(err);
// const oldFormat = obj.pack.pack_format; const oldFormat = obj.pack.pack_format;
// const newFormat = 15; const newFormat = 15;
// obj.pack.pack_format = newFormat; obj.pack.pack_format = newFormat;
// jsonfile.writeFile(`out/${input}/pack.mcmeta`, obj, { spaces: 2 }, function (err) { jsonfile.writeFile(`out/${input}/pack.mcmeta`, obj, { spaces: 2 }, function (err) {
// if (err) console.error(err); if (err) console.error(err);
// console.log(`Pack format changed from ${oldFormat} to ${newFormat}`); console.log(`Pack format changed from ${oldFormat} to ${newFormat}`);
// }); });
// }); });
}); });
} }