Skip to content

Commit accd6cb

Browse files
committed
Merge 1.16 into 1.18
2 parents 70fc671 + 0a9644a commit accd6cb

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,18 +370,40 @@ public void save() throws IOException {
370370

371371
try (Writer writer = new FileWriter(configFile)) {
372372
writer.write("# This is the configuration file for ModernFix.\n");
373+
writer.write("# In general, prefer using the config screen to editing this file. It can be accessed\n");
374+
writer.write("# via the standard mod menu on your respective mod loader. Changes will, however,\n");
375+
writer.write("# require restarting the game to take effect.\n");
373376
writer.write("#\n");
374377
writer.write("# The following options can be enabled or disabled if there is a compatibility issue.\n");
375-
writer.write("# Add a line mixin.example_name=true/false without the # sign to enable/disable a rule.\n");
378+
writer.write("# Add a line with your option name and =true or =false at the bottom of the file to enable\n");
379+
writer.write("# or disable a rule. For example:\n");
380+
writer.write("# mixin.perf.dynamic_resources=true\n");
381+
writer.write("# Do not include the #. You may reset to defaults by deleting this file.\n");
382+
writer.write("#\n");
383+
writer.write("# Available options:\n");
376384
List<String> keys = this.options.keySet().stream()
377385
.filter(key -> !key.equals("mixin.core"))
378386
.sorted()
379387
.collect(Collectors.toList());
380388
for(String line : keys) {
381-
if(!line.equals("mixin.core"))
382-
writer.write("# " + line + "\n");
389+
if(!line.equals("mixin.core")) {
390+
Option option = this.options.get(line);
391+
String extraContext = "";
392+
if(option != null) {
393+
if(!option.isUserDefined())
394+
extraContext = "=" + option.isEnabled() + " # " + (option.isModDefined() ? "(overridden for mod compat)" : "(default)");
395+
else {
396+
boolean defaultEnabled = DEFAULT_SETTING_OVERRIDES.getOrDefault(line, true);
397+
extraContext = "=" + defaultEnabled + " # (default)";
398+
}
399+
}
400+
writer.write("# " + line + extraContext + "\n");
401+
}
383402
}
384403

404+
writer.write("#\n");
405+
writer.write("# User overrides go here.\n");
406+
385407
for (String key : keys) {
386408
Option option = this.options.get(key);
387409
if(option.isUserDefined())

0 commit comments

Comments
 (0)