Skip to content

Commit

Permalink
Update NightConfig and cleanup config code (#172)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Hartte <[email protected]>
  • Loading branch information
Technici4n and shartte authored Jul 7, 2024
1 parent 4eabaff commit af00d44
Show file tree
Hide file tree
Showing 11 changed files with 629 additions and 273 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bootstraplauncher_version=1.1.8
asm_version=9.5
mixin_version=0.14.0+mixin.0.8.6
terminalconsoleappender_version=1.3.0
nightconfig_version=3.6.4
nightconfig_version=3.8.0
jetbrains_annotations_version=24.0.1
slf4j_api_version=1.8.0-beta4
apache_maven_artifact_version=3.8.5
Expand Down
10 changes: 5 additions & 5 deletions loader/src/main/java/net/neoforged/fml/ModContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public <T extends IExtensionPoint> void registerExtensionPoint(Class<T> point, S
extensionPoints.put(point, extension);
}

public void addConfig(final ModConfig modConfig) {
private void addConfig(final ModConfig modConfig) {
configs.put(modConfig.getType(), modConfig);

if (modConfig.getType() == ModConfig.Type.STARTUP) {
Expand All @@ -110,14 +110,14 @@ public void addConfig(final ModConfig modConfig) {
* @param type The type of config
* @param configSpec A config spec
*/
public void registerConfig(ModConfig.Type type, IConfigSpec<?> configSpec) {
public void registerConfig(ModConfig.Type type, IConfigSpec configSpec) {
if (configSpec.isEmpty()) {
// This handles the case where a mod tries to register a config, without any options configured inside it.
LOGGER.debug("Attempted to register an empty config for type {} on mod {}", type, modId);
return;
}

addConfig(new ModConfig(type, configSpec, this));
addConfig(ConfigTracker.INSTANCE.registerConfig(type, configSpec, this));
}

/**
Expand All @@ -127,14 +127,14 @@ public void registerConfig(ModConfig.Type type, IConfigSpec<?> configSpec) {
* @param type The type of config
* @param configSpec A config spec
*/
public void registerConfig(ModConfig.Type type, IConfigSpec<?> configSpec, String fileName) {
public void registerConfig(ModConfig.Type type, IConfigSpec configSpec, String fileName) {
if (configSpec.isEmpty()) {
// This handles the case where a mod tries to register a config, without any options configured inside it.
LOGGER.debug("Attempted to register an empty config for type {} on mod {} using file name {}", type, modId, fileName);
return;
}

addConfig(new ModConfig(type, configSpec, this, fileName));
addConfig(ConfigTracker.INSTANCE.registerConfig(type, configSpec, this, fileName));
}

/**
Expand Down

This file was deleted.

Loading

0 comments on commit af00d44

Please sign in to comment.