Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail if the legacyClassPath.file does not exist #14

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

shartte
Copy link
Contributor

@shartte shartte commented Dec 28, 2023

Motivation

The legacyClassPath is only used in development environments. In production, BSL will fall back to java.class.path, since the Minecraft launcher passes all requested libraries and the Minecraft jar on the classpath.

If the file passed in the legacyClassPath.file system property exists, BSL falls back to using the java.class.path, which is disastrous in dev environment. IDEs put the mods themselves on the class-path too, which leads to BSL converting these mods into modules on the bootstrap layer, causing undecipherable errors when FML later also tries to add the same mods again onto a lower layer.

We've had this error multiple times now when the NeoGradle IDE integration failed to properly write the legacyClassPath file before launching, leading to errors such as:

Exception in thread "main" java.lang.module.ResolutionException: Modules infiniverse and main export package commoble.infiniverse.internal to module infiniverse_examplemod

Or:

Exception in thread "main" java.lang.module.ResolutionException: Module creativecore contains package team.creative.creativecore.common, module main exports package team.creative.creativecore.common to creativecore

Change

This change will now error out immediately if the file given as legacyClassPath.file does not exist.

@sciwhiz12 sciwhiz12 added the enhancement New feature or request label Dec 28, 2023
@marchermans marchermans merged commit 97faffc into McModLauncher:main Dec 28, 2023
1 check passed
@shartte shartte deleted the dont-ignore-lcp-errors branch December 28, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants