1.6.3 • Published 4 months ago
mc-java-core-333 v1.6.3
mc-java-core-333
An autistic fork because I didn't liked the og code. (For now, just redoing the Microsoft module, maybe I will redo the whole code later).
Advantages :dizzy:
!NOTE Most extra parameters use the original minecraft-java-core defaults, so migrating to mc-java-core-333 is seamless and compatible. To get the highest possible optimization offered by this fork check the full list of improvements.
Improved classes until now:
- Microsoft
- Implemented switch statement.
- Removed unnecessary logic.
- Added more intuitive errorTypes.
- XboxAccount value is now optional (a whole auth request just for 3 vars (?)).
- Added doIncludeXboxAccount param (default: true).
- xsts login now includes better error messages in case of XErr code.
- getAuth()
- Added doRemoveCookies param (default: true).
Improved functions until now:
- ForgeMC
- downloadLibraries()
- Removed unnecessary logic.
- Added better check event emitter feedback.
- Priority is given to downloading from the official links first, if provided, and then from the mirrors (instead of the other way around).
- Fixed not reaching on error event.
- Redownloading for corrupted/incomplete libraries.
- patchForge()
- General improvements.
- Fixed not reaching on error event.
- downloadLibraries()
- Loader
- install()
- Improved if conditionals with just an object.
- forge()
- General improvements.
- install()
- download
- checkMirror()
- Minor changes.
- Added check if response.size is an actual number.
- checkMirror()
- forgePatcher
- patcher()
- General improvements.
- Fixed not emitting error event when failing to read jar manifest.
- check()
- Minor changes.
- setArgument()
- Minor changes.
- computePath()
- Minor changes.
- readJarManifest()
- Minor changes.
- patcher()
- src\utils\Index.ts
- getFileFromArchive()
- Improved info in case of error.
- skipLibrary()
- Minor changes
- getFileFromArchive()
From here on it is the same as in the original README.md lol
Install Client
Installation :package:
npm i mc-java-core-333
Usage :triangular_flag_on_post:
Require library
const { Launch, Mojang } = require('mc-java-core-333');
Launch :rocket:
Options
const { Mojang, Launch } = require('mc-java-core-333');
const launch = new Launch();
async function main() {
let opt = {
url: 'https://launcher.luuxis.fr/files/?instance=PokeMoonX',
authenticator: await Mojang.login('Benjas333'),
timeout: 10000,
path: './Minecraft',
instance: 'PokeMoonX',
version: '1.20.4',
detached: false,
intelEnabledMac: true,
downloadFileMultiple: 30,
loader: {
path: '',
type: 'forge',
build: 'latest',
enable: true
},
verify: true,
ignored: [
'config',
'essential',
'logs',
'resourcepacks',
'saves',
'screenshots',
'shaderpacks',
'W-OVERFLOW',
'options.txt',
'optionsof.txt'
],
JVM_ARGS: [],
GAME_ARGS: [],
java: {
path: null,
version: null,
type: 'jre',
},
screen: {
width: 1500,
height: 900
},
memory: {
min: '4G',
max: '6G'
}
}
await launch.Launch(opt);
launch.on('extract', extract => {
console.log(extract);
});
launch.on('progress', (progress, size, element) => {
console.log(`Downloading ${element} ${Math.round((progress / size) * 100)}%`);
});
launch.on('check', (progress, size, element) => {
console.log(`Checking ${element} ${Math.round((progress / size) * 100)}%`);
});
launch.on('estimated', (time) => {
let hours = Math.floor(time / 3600);
let minutes = Math.floor((time - hours * 3600) / 60);
let seconds = Math.floor(time - hours * 3600 - minutes * 60);
console.log(`${hours}h ${minutes}m ${seconds}s`);
})
launch.on('speed', (speed) => {
console.log(`${(speed / 1067008).toFixed(2)} Mb/s`)
})
launch.on('patch', patch => {
console.log(patch);
});
launch.on('data', (e) => {
console.log(e);
})
launch.on('close', code => {
console.log(code);
});
launch.on('error', err => {
console.log(err);
});
}
main()