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

Add --fabric.addMods / -Dfabric.addMods for adding extra path separator separated mods, list file if prefixed with @ #470

Merged
merged 5 commits into from
Jul 17, 2021

Conversation

sfPlayer1
Copy link
Contributor

@sfPlayer1 sfPlayer1 commented Jul 5, 2021

This allows to specify extra mods with

  • the --fabric.addMods program argument
  • the -Dfabric.addMods jvm argument

Each takes a path separated list similar to the class path, e.g. --fabric.addMods=path/modA.jar:/some/path/modB.jar on Linux/MacOS or --fabric.addMods=path/modA.jar;/some/path/modB.jaron Windows

Valid entries for this list are:

  • mod jars
  • unpackaged mod directories (as used in-dev)
  • @-prefixed mod list files with one of the above in each line, similar to java/javac command line argument files

A mod list reference like -Dfabric.addMods=@/some/modList.txt expects modList.txt to contain e.g.

path/modA.jar
/some/path/modB.jar

This PR touches argument handling to ensure correct behavior with Launchwrapper and move some MC specific code where it belongs.

resolves #282 - the launcher has to translate to plain paths though

…or separated mods, list file if prefixed with @
@jordanamr
Copy link

Looks good to me :)

@sfPlayer1 sfPlayer1 marked this pull request as ready for review July 6, 2021 18:31
@liach liach requested review from a team July 7, 2021 00:08
@@ -118,6 +116,7 @@ public void injectIntoClassLoader(LaunchClassLoader launchClassLoader) {
throw new RuntimeException("Could not locate Minecraft: provider locate failed");
}

arguments = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why null out the arguments? Just because they're not needed anymore?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe to allow garbage collection?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just to trap any accidental reuse

@sfPlayer1 sfPlayer1 merged commit ce8405c into FabricMC:master Jul 17, 2021
@EZForever EZForever mentioned this pull request Jul 24, 2021
19 tasks
@vico93
Copy link

vico93 commented Dec 27, 2021

Thank you for this

@NatoBoram
Copy link

NatoBoram commented Feb 2, 2022

Little note for people coming from FabricMC/fabric-installer#53, #181, #357, #521, #512, FabricMC/fabric#1123, #671, #615:

if -Dfabric.addMods= points to a folder path it'll add that recursively
if you however want to have a mods folder for a specific mc version or mod pack you really should instead create a separate "installation" inside the launcher with a custom game directory
which will also isolate the configs and world saves beyond just the mods folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add mod loading from maven-style repository
7 participants