Skip to content

Commit 055892c

Browse files
committed
Merge 1.19.4 into 1.20
2 parents 76d1c8e + 4da012c commit 055892c

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
@@ -371,18 +371,40 @@ public void save() throws IOException {
371371

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

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

0 commit comments

Comments
 (0)