1.2.2 • Published 3 years ago

emc-core v1.2.2

Weekly downloads
172
License
MIT
Repository
-
Last release
3 years ago

EMC-Core

NodeJS Module for Electron Minecraft launcher

Avantages :dizzy:

EMC-Core is a upgrade of minecraft-launcher-core dev by Pierce01

  • 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:

git clone https://github.com/Zeldown/EMC-Core-quick-start.git
cd EMC-Core-quick-start
npm install
npm start

Installation :package:

npm install emc-core

Usage :triangular_flag_on_post:

Require library

const { MCAuth, MCLaunch } = require('emc-core');

Create and Init launcher var MCLaunch

const launcher = new MCLaunch();

Authentification :lock:

Mojang

let authenticator;

MCAuth.auth(username, password).then(user => {
  authenticator = user;
  //success
}).catch(error => {
  //error
})

username => The email of mojang account

password => The password of mojang account

Return

const user = {
  access_token: uuid(),
  client_token: uuid(),
  uuid: uuid(),
  name: username,
  user_properties: JSON.stringify({})
}

Microsoft

InDev

Launch :rocket:

Options

let opts = {
  url: "http://zeldown.com/emc-core/",
  overrides: {
    detached: false
  },
  authorization: authenticator,
  root: "C:/Users/guill/AppData/Roaming/.emc-core",
  version: "1.15.2",
  forge: "1.15.2-forge-31.2.0",
  checkFiles: true,
  memory: {
      max: "6G",
      min: "4G"
  }
}
OptionTypeDescriptionRequired
urlStringUrl of files to downloadtrue
authorizationAuthentificatorThe authentificator variable get when MCAutotrue
rootStringThe path to minecraft directorytrue
versionStringThe version of minecrafttrue
checkFilesBooleanCheck or not file to deletetrue
forgeStringThe name of used forgefalse
memoryArrayThe informations of memory, contains max and minfalse

Launching

launcher.launch(opts);

Debugging :bug:

To get debug use launcher.on('xxx', (e) => ...)

debug

call when a debug log is print by Minecraft

launcher.on('debug', (e) => console.log("[DEBUG]" + e));

data

call when a data log is print by Minecraft

launcher.on('data', (e) => console.log("[DATA]" + e));

error

call when a error log is print by Minecraft

launcher.on('error', (e) => console.log("[ERROR]" + e));

download-status

call when a download file progress

launcher.on('download-status', (e) => {
  //update progress bar
});
NameTypeDescription
nameStringThe name of current file is downloading
typeStringThe type of file (assets, natives, java, mods, ...)
currentDownloadedBytesintThe count of bytes downloaded of file
currentBytesToDownloadintThe count of bytes to download of file
downloadedBytesintThe count of bytes downloaded of folder
bytesToDownloadintThe count of bytes to download of folder
downloadFilesintThe count of file downloaded of folder
filesToDownloadintThe count of file to download of folder

verification-status

call when a verification of files progress

launcher.on('verification-status', (e) => {
  //update verification bar
});
NameTypeDescription
nameStringThe url of verified file
currentintThe count of files checked
totalintThe count of files to check

launch

call when Minecraft start launching

launcher.on('launch', (e) => {
  //Minecraft start
});

Install Server :construction:

:rotating_light: You must have a web hosting

PreBuild Server Version

  1. Download EMC-Core-Server of your version at https://github.com/Zeldown/EMC-Core/releases
  2. Extract archive on your computer
  3. In EMC-Core-Server/files put your files to download (mods, config, etc). Default files in folder is mandatory (assets, libraries, natives, versions)
  4. Put the folder EMC-Core-Server to your web hosting (exemple: upload folder EMC-Core-Server at https://exemple.com/)
  5. Set url option of launch options to url of content of EMC-Core-Server (exemple: https://exemple.com/EMC-Core-Server)
let opts = {
  url: url_of_emc-core-server,
  ...
}

Build EMC-Core-Server with builder.js

  1. Clone EMC-Core project at https://github.com/Zeldown/EMC-Core
  2. Extract archive on your computer
  3. Go into emc-core extracted folder
  4. run npm i
  5. run node utils/builder.js --version="@version" --path="@path"
NameTypeDescription
@versionStringThe name of minecraft vanilla version (e.g. 1.15.2)
@pathStringThe full path where build will be created (path must be exists)

Build custom EMC-Core-Server

  1. Create a folder with the file reader.php
  2. Create a folder java
  3. Put an archive of java named java.zip in java folder (exemple : java.zip)
  4. Create a folder files
  5. Put all files of minecraft in folder files like assets, library, natives, mods, versions
  6. Put your custom folder to your web hosting (exemple: upload folder My-Version at https://exemple.com/)
  7. Set url option of launch options to url of content of custom folder (exemple: https://exemple.com/My-Version)
let opts = {
  url: url_of_your_uploaded_version,
  ...
}

EMC-Core-Server schema

Here is a schema of a classic emc-core-server archive

emc-core-server

EMC-Core-Server with forge

  1. Build a vanilla emc-core-server version with the base version of your forge (e.g. 1.15.2)
  2. Add your forge version files (@forge_version.json & @forge_version.jar) into EMC-Core-Server/versions/@forge_version (e.g. versions/1.15.2-forge-31.2.0/)
  3. Add forge libraries into EMC-Core-Server/libraries

(natives & assets are same in vanilla and forge version)

Credits :tada:

Based on code of Pierce01 :heart:

Special thanks to Faustin#8347 for code help & readme review

Thanks to Relax#3333 for funding

1.2.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.0.131

3 years ago

1.1.0

3 years ago

1.0.130

3 years ago

1.0.129

3 years ago

1.0.128

3 years ago

1.0.125

3 years ago

1.0.124

3 years ago

1.0.127

3 years ago

1.0.126

3 years ago

1.0.123

3 years ago

1.0.122

3 years ago

1.0.121

3 years ago

1.0.120

3 years ago

1.0.119

3 years ago

1.0.118

3 years ago

1.0.117

3 years ago

1.0.116

3 years ago

1.0.115

3 years ago

1.0.114

3 years ago

1.0.113

3 years ago

1.0.112

3 years ago

1.0.111

3 years ago

1.0.109

3 years ago

1.0.110

3 years ago

1.0.108

3 years ago

1.0.107

3 years ago

1.0.106

3 years ago

1.0.105

3 years ago

1.0.103

3 years ago

1.0.104

3 years ago

1.0.102

3 years ago

1.0.101

3 years ago

1.0.100

3 years ago

1.0.99

3 years ago

1.0.98

3 years ago

1.0.97

3 years ago

1.0.96

3 years ago

1.0.95

3 years ago

1.0.94

3 years ago

1.0.93

3 years ago

1.0.92

3 years ago

1.0.88

3 years ago

1.0.87

3 years ago

1.0.89

3 years ago

1.0.91

3 years ago

1.0.90

3 years ago

1.0.84

3 years ago

1.0.83

3 years ago

1.0.82

3 years ago

1.0.86

3 years ago

1.0.85

3 years ago

1.0.81

3 years ago

1.0.79

3 years ago

1.0.80

3 years ago

1.0.78

3 years ago

1.0.77

3 years ago

1.0.76

3 years ago

1.0.75

3 years ago

1.0.74

3 years ago

1.0.73

3 years ago

1.0.72

3 years ago

1.0.71

3 years ago

1.0.69

3 years ago

1.0.70

3 years ago

1.0.68

3 years ago

1.0.67

3 years ago

1.0.66

3 years ago

1.0.65

3 years ago

1.0.64

3 years ago

1.0.63

3 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.60

3 years ago

1.0.59

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.55

3 years ago

1.0.54

3 years ago

1.0.53

3 years ago

1.0.52

3 years ago

1.0.51

3 years ago

1.0.50

3 years ago

1.0.48

3 years ago

1.0.47

3 years ago

1.0.46

3 years ago

1.0.49

3 years ago

1.0.45

3 years ago

1.0.44

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.40

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.29

3 years ago

1.0.30

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago