diff --git a/components/handler.js b/components/handler.js index 5d3b5fa..abcdf78 100644 --- a/components/handler.js +++ b/components/handler.js @@ -3,6 +3,7 @@ const shelljs = require('shelljs'); const path = require('path'); const request = require('request'); const zip = require('adm-zip'); +const event = require('./events'); function downloadAsync (url, directory, name) { @@ -220,8 +221,13 @@ module.exports.makePackage = async function(versions, os) { }; module.exports.extractPackage = function(root, clientPackage) { - return new Promise(resolve => { + return new Promise(async resolve => { + if(clientPackage.startsWith('http')) { + await downloadAsync(clientPackage, root, "clientPackage.zip") + clientPackage = path.join(root, "clientPackage.zip") + } new zip(clientPackage).extractAllTo(root, true); + event.emit('package-extract', true); resolve(); }); }; \ No newline at end of file diff --git a/package.json b/package.json index a6e840b..b3a449e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-launcher-core", - "version": "1.1.0", + "version": "1.2.0", "description": "Module that downloads Minecraft assets and runs Minecraft.", "main": "index.js", "dependencies": {