1.6.3 • Published 4 months ago

mc-java-core-333 v1.6.3

Weekly downloads
-
License
CCANC
Repository
github
Last release
4 months ago

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
    1. Implemented switch statement.
    2. Removed unnecessary logic.
    3. Added more intuitive errorTypes.
    4. XboxAccount value is now optional (a whole auth request just for 3 vars (?)).
      1. Added doIncludeXboxAccount param (default: true).
    5. xsts login now includes better error messages in case of XErr code.
    • getAuth()
      1. Added doRemoveCookies param (default: true).

Improved functions until now:

  • ForgeMC
    • downloadLibraries()
      1. Removed unnecessary logic.
      2. Added better check event emitter feedback.
      3. Priority is given to downloading from the official links first, if provided, and then from the mirrors (instead of the other way around).
      4. Fixed not reaching on error event.
      5. Redownloading for corrupted/incomplete libraries.
    • patchForge()
      1. General improvements.
      2. Fixed not reaching on error event.
  • Loader
    • install()
      1. Improved if conditionals with just an object.
    • forge()
      1. General improvements.
  • download
    • checkMirror()
      1. Minor changes.
      2. Added check if response.size is an actual number.
  • forgePatcher
    • patcher()
      1. General improvements.
      2. Fixed not emitting error event when failing to read jar manifest.
    • check()
      1. Minor changes.
    • setArgument()
      1. Minor changes.
    • computePath()
      1. Minor changes.
    • readJarManifest()
      1. Minor changes.
  • src\utils\Index.ts
    • getFileFromArchive()
      1. Improved info in case of error.
    • skipLibrary()
      1. Minor changes

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()
1.6.3

4 months ago

1.6.2

4 months ago

1.6.1

4 months ago

1.6.0

4 months ago

1.5.0

5 months ago

1.4.3

5 months ago

1.4.2

5 months ago

1.4.1

5 months ago

1.4.0

5 months ago

1.3.0

5 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.0

6 months ago