From e2f7e1088c1d980fe2e1d3ac03e04dd161424598 Mon Sep 17 00:00:00 2001 From: Pierce Date: Sat, 4 Jan 2020 18:21:12 -0500 Subject: [PATCH] 3.11.6 - Fabric support Defaults back to normal MC jar if a custom one doesnt exist. --- README.md | 5 ++--- components/handler.js | 2 ++ components/launcher.js | 3 ++- package.json | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index add04d7..ca5261d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ##### This project is complete for now. [![Build Status](https://travis-ci.com/Pierce01/MinecraftLauncher-core.svg?branch=master)](https://travis-ci.com/Pierce01/MinecraftLauncher-core) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -![version](https://img.shields.io/badge/stable_version-3.11.3-blue) +![version](https://img.shields.io/badge/stable_version-3.11.5-blue) ![badge](https://img.shields.io/badge/ncurses-not_supported-purple) MCLC (Minecraft Launcher Core) is a NodeJS solution for launching modded and vanilla Minecraft without having to download and format everything yourself. @@ -115,8 +115,7 @@ let opts = { #### Notes ##### Custom -If you are loading up a client outside of vanilla Minecraft or Forge (Optifine and for an example), you'll need to download the needed files yourself -if you don't provide downloads url downloads like Forge and Fabric. Still need to provide the version jar. +If you are loading up a client outside of vanilla Minecraft or Forge (Optifine and for an example), you'll need to download the needed files yourself if you don't provide downloads url downloads like Forge and Fabric. If no version jar is specified, MCLC will default back to the normal MC jar so mods like Fabric work. ##### Installer You'll need to provide the folder created in the versions if you're running the new forge like so ```json diff --git a/components/handler.js b/components/handler.js index 3ec94db..fa2c1a8 100644 --- a/components/handler.js +++ b/components/handler.js @@ -265,6 +265,8 @@ class Handler { }); await Promise.all(stat.map(async (native) => { + // Edge case on some systems where native is undefined and throws an error, this should fix it. + if(!native) return; const name = native.path.split('/').pop(); await this.downloadAsync(native.url, nativeDirectory, name, true, 'natives'); if (!await this.checkSum(native.sha1, path.join(nativeDirectory, name))) { diff --git a/components/launcher.js b/components/launcher.js index 5c8c41e..331b4bf 100644 --- a/components/launcher.js +++ b/components/launcher.js @@ -106,7 +106,8 @@ class MCLCore extends EventEmitter { classPaths.push(forge.forge.mainClass) } else { const file = custom || versionFile; - const jar = fs.existsSync(mcPath) ? `${mcPath}${separator}` : ''; + // So mods like fabric work. + const jar = fs.existsSync(mcPath) ? `${mcPath}${separator}` : `${path.join(directory, `${this.options.version.number}.jar`)}${separator}`; classPaths.push(`${jar}${classes.join(separator)}`); classPaths.push(file.mainClass); } diff --git a/package.json b/package.json index 9ae7e08..cb92877 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-launcher-core", - "version": "3.11.5", + "version": "3.11.6", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "main": "index.js", "dependencies": {