diff --git a/components/handler.js b/components/handler.js index fa2c1a8..a8f5b44 100644 --- a/components/handler.js +++ b/components/handler.js @@ -147,7 +147,7 @@ class Handler { `${this.version.assetIndex.id}.json`, true, 'asset-json'); } - const index = require(path.join(this.options.root, 'assets', 'indexes',`${this.version.assetIndex.id}.json`)); + const index = JSON.parse(fs.readFileSync(path.join(this.options.root, 'assets', 'indexes',`${this.version.assetIndex.id}.json`), { encoding: 'utf8' })); this.client.emit('progress', { type: 'assets', @@ -309,7 +309,7 @@ class Handler { return null; } - const forge = require(path.join(this.options.root, 'forge', `${this.version.id}`, 'version.json')); + const forge = JSON.parse(fs.readFileSync(path.join(this.options.root, 'forge', `${this.version.id}`, 'version.json'), { encoding: 'utf8' })); const paths = []; this.client.emit('progress', { @@ -376,7 +376,7 @@ class Handler { const libs = []; if(this.options.version.custom) { - const customJarJson = require(path.join(this.options.root, 'versions', this.options.version.custom, `${this.options.version.custom}.json`)); + const customJarJson = JSON.parse(fs.readFileSync(path.join(this.options.root, 'versions', this.options.version.custom, `${this.options.version.custom}.json`), { encoding: 'utf9'})); this.client.emit('progress', { type: 'classes-custom', diff --git a/components/launcher.js b/components/launcher.js index 331b4bf..44dc29e 100644 --- a/components/launcher.js +++ b/components/launcher.js @@ -27,7 +27,7 @@ class MCLCore extends EventEmitter { // Lets the events register. our magic switch! await void(0); - this.emit('debug', `[MCLC]: MCLC version ${require(path.join(__dirname,'..', 'package.json')).version}`); + this.emit('debug', `[MCLC]: MCLC version ${JSON.parse(fs.readFileSync(path.join(__dirname,'..', 'package.json'), { encoding: 'utf8' })).version}`); const java = await this.handler.checkJava(this.options.javaPath || 'java'); if(!java.run) { this.emit('debug', `[MCLC]: Couldn't start Minecraft due to: ${java.message}`); @@ -75,7 +75,7 @@ class MCLCore extends EventEmitter { } if(this.options.version.custom) { this.emit('debug', '[MCLC]: Detected custom in options, setting custom version file'); - custom = require(path.join(this.options.root, 'versions', this.options.version.custom, `${this.options.version.custom}.json`)); + custom = JSON.parse(fs.readFileSync(path.join(this.options.root, 'versions', this.options.version.custom, `${this.options.version.custom}.json`), { encoding: 'utf8' })); } const args = [];