Pierce01 / MinecraftLauncher-core

Lightweight module that downloads and runs Minecraft using javascript / NodeJS
MIT License
356 stars 81 forks source link

Fixed custom mod loader crashes #108

Closed Agent-01 closed 1 year ago

Agent-01 commented 1 year ago

Issue

When using this module to launch mod loaders like fabric and forge, the argument of -cp uses Minecraft_version.jar instead of the specific format of forge or fabric like 1.18.2-forge-40.2.0.jar, making Minecraft crash.

Fix

Use the name of the jar file if specified, or use the custom version if specified, otherwise use the version number.


This is my first time contributing to a GitHub project, sorry if I did anything wrong.

Pierce01 commented 1 year ago

Quick question: are you specifying forge in opts.forge, or in opts.version.custom? If the ladder, you shouldn't be; you need to specify the forge installer in opts.forge, so ForgeWrapper can handle the rest. I'm asking since forge logic isn't being changed in this PR.

Agent-01 commented 1 year ago

I'm sorry, the code is working fine. The issue was that opts.overrides.minecraftJar requires a full path. I thought it was just the name of the jar, as the directory is specified in opts.overrides.directory. This fixed the issue.

Pierce01 commented 1 year ago

No worries! Have a good one.