Added option to specify JRE executable file

This commit is contained in:
MelonCode 2019-04-02 02:58:47 +03:00
parent b95ef6f9a2
commit 82b441d0f7
2 changed files with 2 additions and 1 deletions

View file

@ -40,6 +40,7 @@ launcher.authenticator.getAuth("email", "password").then(auth => {
| `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 |
| `options.os` | String | windows, osx or linux | True | | `options.os` | String | windows, osx or linux | True |
| `options.javaPath` | String | Path to the JRE executable file, will default to `java` if not entered. | False |
| `options.version.number` | String | Minecraft version that is going to be launched. | True | | `options.version.number` | String | Minecraft version that is going to be launched. | True |
| `options.version.type` | String | Any string. The actual Minecraft launcher uses `release` and `snapshot`. | True | | `options.version.type` | String | Any string. The actual Minecraft launcher uses `release` and `snapshot`. | True |
| `options.memory.max` | String | Max amount of memory being used by Minectaft | True | | `options.memory.max` | String | Max amount of memory being used by Minectaft | True |

View file

@ -61,7 +61,7 @@ module.exports = async function (options) {
const launchArguments = args.concat(jvm, classPaths, launchOptions); const launchArguments = args.concat(jvm, classPaths, launchOptions);
const minecraft = child.spawn(`java`, launchArguments); const minecraft = child.spawn(options.javaPath ? options.javaPath : 'java', launchArguments);
event.emit('start', null); event.emit('start', null);
minecraft.stdout.on('data', (data) => event.emit('data', data)); minecraft.stdout.on('data', (data) => event.emit('data', data));
minecraft.stderr.on('data', (data) => event.emit('error', data)); minecraft.stderr.on('data', (data) => event.emit('error', data));