Updated documentation.

This commit is contained in:
Pierce 2019-02-08 14:02:42 -05:00
parent f9fc29ee67
commit c3c864df50

View file

@ -2,6 +2,7 @@
### Currently only supports MC 1.7.3 and up. ### Currently only supports MC 1.7.3 and up.
A script that launches Minecraft using NodeJS. A script that launches Minecraft using NodeJS.
Supports Vanilla and Forge.
### Installing ### Installing
@ -13,7 +14,7 @@ A script that launches Minecraft using NodeJS.
##### launcher.core Options ##### launcher.core Options
| Parameter | Type | Description | Required | | Parameter | Type | Description | Required |
|------------------|----------|-------------------------------------------------------------------------------------------|----------| |--------------------------|--------|-------------------------------------------------------------------------------------------|----------|
| `options.authorization` | Object | The result from `getAuth` function, allows the client to login in online or offline mode. | True | | `options.authorization` | Object | The result from `getAuth` function, allows the client to login in online or offline mode. | True |
| `options.clientPackage` | String | Path to the client package zip file. | False | | `options.clientPackage` | String | Path to the client package zip file. | False |
| `options.root` | String | Path where you want the launcher to work in. like `C:/Users/user/AppData/Roaming/.mc` | True | | `options.root` | String | Path where you want the launcher to work in. like `C:/Users/user/AppData/Roaming/.mc` | True |
@ -45,6 +46,16 @@ A script that launches Minecraft using NodeJS.
| `client_token` | String | Token being checked if it's the same client that the access_token was created from. | True | | `client_token` | String | Token being checked if it's the same client that the access_token was created from. | True |
| `selected_profile` | Object | Json Object that was returned from Mojangs auth api. | True | | `selected_profile` | Object | Json Object that was returned from Mojangs auth api. | True |
#### Events
| Event Name | Type | Description |
|-------------------|---------|-------------------------------------------------------------------------------------|
| `data` | Buffer | Emitted when information is returned from the Minecraft Process |
| `close` | Integer | Code number that is returned by the Minecraft Process |
| `error` | String | Emitted when the Minecraft Process errors |
| `package-extract` | null | Emitted when `clientPackage` finishes being extracted |
| `start` | null | Emitted after `launchOptions` are set. THIS WILL BE DEPRECATED AS ITS NOT ACCURATE |
#### Client Package Function #### Client Package Function
Client Packages allow the client to run offline on setup. This function should be used outside the actual launcher. Client Packages allow the client to run offline on setup. This function should be used outside the actual launcher.
@ -67,6 +78,7 @@ launcher.authenticator.getAuth("email", "password").then(auth => {
launcher.core({ launcher.core({
authorization: auth, authorization: auth,
clientPackage: null, clientPackage: null,
forge: null,
root: "C:/Users/user/AppData/Roaming/.mc", root: "C:/Users/user/AppData/Roaming/.mc",
os: "windows", os: "windows",
version: { version: {
@ -104,6 +116,29 @@ launcher.core({
}); });
``` ```
##### Using With Forge
```js
launcher.authenticator.getAuth("email", "password").then(auth => {
launcher.core({
authorization: auth,
clientPackage: null,
root: "C:/Users/user/AppData/Roaming/.mc",
forge: {
path: "C:/Users/user/Desktop/forge.jar"
},
os: "windows",
version: {
number: "1.12.2", // needs to be the same as the Forge version
type: "MCC-Launcher"
},
memory: {
max: "500"
}
});
});
```
#### What should it look like running from console? #### What should it look like running from console?