Skip to content

Conversation

@Player3324
Copy link
Contributor

@Player3324 Player3324 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 :)

@Player3324 Player3324 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
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

@Player3324 Player3324 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