Skip to content

stage2/lw: Fix crash when Minecraft and temp files are on separate drives#34

Merged
Johni0702 merged 1 commit intomasterfrom
fix/extra-mod-injections-errors-when-minecraft-is-on-second-drive
Feb 18, 2026
Merged

stage2/lw: Fix crash when Minecraft and temp files are on separate drives#34
Johni0702 merged 1 commit intomasterfrom
fix/extra-mod-injections-errors-when-minecraft-is-on-second-drive

Conversation

@Johni0702
Copy link
Contributor

The way we used to pass extra jars which may contain mods to Forge, via its --mods argument, only accepts relative paths, and on Windows it is impossible to construct a relative path when the two paths are on different drive letters.

This commit now instead uses our existing RelaunchTransformer to modify the code in Forge which parses the --mods argument, to manually inject the absolute paths to any such extra mods right after the regular --mods parsing.

…ives

The way we used to pass extra jars which may contain mods to Forge, via
its `--mods` argument, only accepts relative paths, and on Windows it is
impossible to construct a relative path when the two paths are on
different drive letters.

This commit now instead uses our existing RelaunchTransformer to modify
the code in Forge which parses the `--mods` argument, to manually inject
the absolute paths to any such extra mods right after the regular
`--mods` parsing.
@github-actions
Copy link

github-actions bot commented Feb 16, 2026

Test Results

17 files  ±0  17 suites  ±0   11m 34s ⏱️ -9s
90 tests ±0  90 ✅ ±0  0 💤 ±0  0 ❌ ±0 
94 runs  ±0  94 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 97d78f5. ± Comparison against base commit 1685fd1.

♻️ This comment has been updated with latest results.

@Traben-0 Traben-0 self-requested a review February 18, 2026 10:09
Copy link

@Traben-0 Traben-0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL what sic means lol

lgtm, its just now using a system property rather than passing them in as args due to a forge issue

while (ret.getOpcode() != Opcodes.ARETURN) {
ret = ret.getPrevious();
}
instructions.insertBefore(ret, new InsnNode(Opcodes.DUP));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: looks like there is a sort() run on the list prior to its return in the original method, which i think this messes up, I doubt it's important, but it is a behavioral difference

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm guessing it's just so mod loading order doesn't depend on file system iteration order. And since we also sort our mod list, that should still be the case.

@Johni0702 Johni0702 merged commit b300222 into master Feb 18, 2026
37 checks passed
@Johni0702 Johni0702 deleted the fix/extra-mod-injections-errors-when-minecraft-is-on-second-drive branch February 18, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments