Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8422b07359
18
index.js
18
index.js
|
@ -1,12 +1,19 @@
|
|||
const decompress = require('decompress');
|
||||
const fs = require('fs');
|
||||
const jsonfile = require('jsonfile')
|
||||
const file = 'blocks.json'
|
||||
let blocks;
|
||||
jsonfile.readFile(file, function (err, obj) {
|
||||
if (err) console.error(err)
|
||||
// console.dir(obj)
|
||||
blocks = obj;
|
||||
})
|
||||
|
||||
extract("1.8")
|
||||
// extract("1.20.1")
|
||||
|
||||
function extract(string) {
|
||||
decompress(`test/${string}.zip`, `out/${string}`).then(files => {
|
||||
console.log("extracted")
|
||||
// try {
|
||||
// fs.renameSync(`out/${string}/assets/minecraft/textures/blocks`, `out/${string}/assets/minecraft/textures/block`)
|
||||
// fs.renameSync(`out/${string}/assets/minecraft/textures/items`, `out/${string}/assets/minecraft/textures/item`)
|
||||
|
@ -14,8 +21,13 @@ function extract(string) {
|
|||
// console.log(error);
|
||||
// }
|
||||
files.forEach(element => {
|
||||
// console.log(`Extracted ${element.path} from ${string}.zip`)
|
||||
console.log(files)
|
||||
if (!element.path.includes("assets/minecraft/textures/")) {
|
||||
return;
|
||||
}
|
||||
let texture = element.path.match(/(?:[A-Za-z]*\/)*([A-za-z]*)\/([A-Za-z_]*).png/);
|
||||
// let type = texture[0]
|
||||
// let name = texture[1]
|
||||
console.log(texture)
|
||||
})
|
||||
})
|
||||
}
|
22
package-lock.json
generated
22
package-lock.json
generated
|
@ -9,7 +9,8 @@
|
|||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"decompress": "^4.2.1"
|
||||
"decompress": "^4.2.1",
|
||||
"jsonfile": "^6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/base64-js": {
|
||||
|
@ -277,6 +278,17 @@
|
|||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
|
||||
},
|
||||
"node_modules/jsonfile": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||
"dependencies": {
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"node_modules/make-dir": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
|
||||
|
@ -456,6 +468,14 @@
|
|||
"through": "^2.3.8"
|
||||
}
|
||||
},
|
||||
"node_modules/universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
||||
"engines": {
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
"description": "L vipermc",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "rm -r out && mkdir out && node index.js"
|
||||
"start": "rm -r out && mkdir out && node index.js",
|
||||
"test": "clear && npm start"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"decompress": "^4.2.1"
|
||||
"decompress": "^4.2.1",
|
||||
"jsonfile": "^6.1.0"
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue
Block a user