Skip to content

Commit

Permalink
Fix inputGameJars ObjectShare mutating after being set (#876)
Browse files Browse the repository at this point in the history
* fix inputGameJars ObjectShare mutating after being set

* make defensive copy unmodifiable

* document behavior
  • Loading branch information
tildejustin authored Jan 15, 2024
1 parent eacadb4 commit 1030e56
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public boolean locateGame(FabricLauncher launcher, String[] args) {
// expose obfuscated jar locations for mods to more easily remap code from obfuscated to intermediary
ObjectShare share = FabricLoaderImpl.INSTANCE.getObjectShare();
share.put("fabric-loader:inputGameJar", gameJars.get(0)); // deprecated
share.put("fabric-loader:inputGameJars", gameJars);
share.put("fabric-loader:inputGameJars", Collections.unmodifiableList(new ArrayList<>(gameJars))); // need to make copy as gameJars is later mutated to hold the remapped jars
if (realmsJar != null) share.put("fabric-loader:inputRealmsJar", realmsJar);

String version = arguments.remove(Arguments.GAME_VERSION);
Expand Down

0 comments on commit 1030e56

Please sign in to comment.