doc: rename functions

This commit is contained in:
Artemy 2023-06-18 14:41:41 +03:00
parent e832e963f8
commit a6cfdd3c8e

View file

@ -35,7 +35,7 @@ class MCLCore extends EventEmitter {
this.handler = new Handler(this) this.handler = new Handler(this)
this.printVersion() this._printVersion()
const java = await this.handler.checkJava(this.options.javaPath || 'java') const java = await this.handler.checkJava(this.options.javaPath || 'java')
if (!java.run) { if (!java.run) {
@ -44,10 +44,10 @@ class MCLCore extends EventEmitter {
return null return null
} }
this.createRootDirectory() this._createRootDirectory()
this.createGameDirectory() this._createGameDirectory()
await this.extractPackage() await this._extractPackage()
if (this.options.installer) { if (this.options.installer) {
// So installers that create a profile in launcher_profiles.json can run without breaking. // So installers that create a profile in launcher_profiles.json can run without breaking.
@ -77,7 +77,7 @@ class MCLCore extends EventEmitter {
await this.handler.getJar() await this.handler.getJar()
} }
const modifyJson = await this.getModifyJson() const modifyJson = await this._getModifyJson()
const args = [] const args = []
@ -146,21 +146,21 @@ class MCLCore extends EventEmitter {
} }
} }
printVersion () { _printVersion () {
if (fs.existsSync(path.join(__dirname, '..', 'package.json'))) { if (fs.existsSync(path.join(__dirname, '..', 'package.json'))) {
const { version } = require('../package.json') const { version } = require('../package.json')
this.emit('debug', `[MCLC]: MCLC version ${version}`) this.emit('debug', `[MCLC]: MCLC version ${version}`)
} else { this.emit('debug', '[MCLC]: Package JSON not found, skipping MCLC version check.') } } else { this.emit('debug', '[MCLC]: Package JSON not found, skipping MCLC version check.') }
} }
createRootDirectory () { _createRootDirectory () {
if (!fs.existsSync(this.options.root)) { if (!fs.existsSync(this.options.root)) {
this.emit('debug', '[MCLC]: Attempting to create root folder') this.emit('debug', '[MCLC]: Attempting to create root folder')
fs.mkdirSync(this.options.root) fs.mkdirSync(this.options.root)
} }
} }
createGameDirectory () { _createGameDirectory () {
if (this.options.overrides.gameDirectory) { if (this.options.overrides.gameDirectory) {
this.options.overrides.gameDirectory = path.resolve(this.options.overrides.gameDirectory) this.options.overrides.gameDirectory = path.resolve(this.options.overrides.gameDirectory)
if (!fs.existsSync(this.options.overrides.gameDirectory)) { if (!fs.existsSync(this.options.overrides.gameDirectory)) {
@ -169,14 +169,14 @@ class MCLCore extends EventEmitter {
} }
} }
async extractPackage () { async _extractPackage () {
if (this.options.clientPackage) { if (this.options.clientPackage) {
this.emit('debug', `[MCLC]: Extracting client package to ${this.options.root}`) this.emit('debug', `[MCLC]: Extracting client package to ${this.options.root}`)
await this.handler.extractPackage() await this.handler.extractPackage()
} }
} }
async getModifyJson () { async _getModifyJson () {
let modifyJson = null let modifyJson = null
if (this.options.forge) { if (this.options.forge) {