Skip to content

Commit

Permalink
Add file name override and direct ModLoadingContext to new methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyces committed Mar 20, 2024
1 parent a727904 commit 2365efc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions loader/src/main/java/net/neoforged/fml/ModContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ public void registerConfig(ModConfig.Type type, IConfigSpec<?> configSpec) {
addConfig(new ModConfig(type, configSpec, this));
}

public void registerConfig(ModConfig.Type type, IConfigSpec<?> configSpec, String fileName) {
addConfig(new ModConfig(type, configSpec, this, fileName));
}

/**
* Does this mod match the supplied mod?
*
Expand Down
4 changes: 2 additions & 2 deletions loader/src/main/java/net/neoforged/fml/ModLoadingContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void registerConfig(ModConfig.Type type, IConfigSpec<?> spec) {
return;
}

getActiveContainer().addConfig(new ModConfig(type, spec, getActiveContainer()));
getActiveContainer().registerConfig(type, spec);
}

public void registerConfig(ModConfig.Type type, IConfigSpec<?> spec, String fileName) {
Expand All @@ -67,7 +67,7 @@ public void registerConfig(ModConfig.Type type, IConfigSpec<?> spec, String file
return;
}

getActiveContainer().addConfig(new ModConfig(type, spec, getActiveContainer(), fileName));
getActiveContainer().registerConfig(type, spec, fileName);
}


Expand Down

0 comments on commit 2365efc

Please sign in to comment.