mirror of
https://github.com/RoyalnetworkTR/minecraft-java-core.git
synced 2026-09-25 01:49:52 +03:00
94 lines
2.6 KiB
Markdown
94 lines
2.6 KiB
Markdown
# minecraft-java-core
|
|
NodeJS Module for Minecraft launcher
|
|
<br>
|
|
[](https://npmjs.com/minecraft-java-core)
|
|
<br>
|
|
[](https://npmjs.com/minecraft-java-core)
|
|
<br>
|
|
[](https://npmjs.com/minecraft-java-core)
|
|
<br>
|
|
[](https://npmjs.com/minecraft-java-core)
|
|
|
|
---
|
|
## Avantages :dizzy:
|
|
- Auto check & downloading compatible java version
|
|
- Support 100% custom minecraft version
|
|
- Work with ftp without any zip file, juste drop folder in your ftp
|
|
- Auto check & delete file with bad hash & size
|
|
|
|
# Install Client
|
|
|
|
## Quick Start :zap:
|
|
```npm
|
|
git clone https://github.com/luuxis/Selvania-Launcher.git
|
|
cd Selvania-Launcher
|
|
npm install
|
|
npm start
|
|
```
|
|
|
|
## Installation :package:
|
|
```npm
|
|
npm i minecraft-java-core
|
|
```
|
|
|
|
## Usage :triangular_flag_on_post:
|
|
Require library
|
|
```javascript
|
|
const { Launch, Mojang } = require('minecraft-java-core');
|
|
```
|
|
|
|
## Launch :rocket:
|
|
### Options
|
|
```javascript
|
|
const { Launch, Mojang } = require('minecraft-java-core');
|
|
const launch = new Launch();
|
|
|
|
let opts = {
|
|
url: "http://launcher.selvania.fr/files",
|
|
authenticator: Mojang.getAuth('luuxis'),
|
|
path: "./.Minecraft",
|
|
version: "1.19",
|
|
detached: false,
|
|
java: true,
|
|
args: [],
|
|
modde: true,
|
|
verify: false,
|
|
ignored: ["crash-reports", "logs", "resourcepacks", "resources", "saves", "shaderpacks", "options.txt", "optionsof.txt"],
|
|
|
|
memory: {
|
|
min: `1G`,
|
|
max: `2G`
|
|
}
|
|
}
|
|
|
|
launch.Launch(opts)
|
|
|
|
launch.on('progress', (DL, totDL) => {
|
|
console.log(`${(DL / 1067008).toFixed(2)} Mb to ${(totDL / 1067008).toFixed(2)} Mb`);
|
|
});
|
|
|
|
launch.on('speed', (speed) => {
|
|
console.log(`${(speed / 1067008).toFixed(2)} Mb/s`)
|
|
})
|
|
|
|
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('data', (e) => {
|
|
console.log(e)
|
|
})
|
|
|
|
launch.on('close', () => {
|
|
console.clear();
|
|
console.log("game closed");
|
|
})
|
|
```
|
|
---
|
|
<br>
|
|
|
|
[<p align="center"><img src="https://discordapp.com/api/guilds/819729377650278420/embed.png?style=banner4" alt="discord">](https://discord.gg/e9q7Yr2cuQ)
|