From e65f8fbb32297d693fc552ab1998a3928b2bfe03 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Wed, 19 Jul 2023 10:05:09 -0400 Subject: [PATCH] Add option to override overrides Absolutely no support is guaranteed when this is used --- .../modernfix/core/config/ModernFixEarlyConfig.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java b/common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java index e3413561..d19530da 100644 --- a/common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java +++ b/common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java @@ -31,6 +31,8 @@ public class ModernFixEarlyConfig { private final Map options = new HashMap<>(); private final Multimap optionsByCategory = HashMultimap.create(); + private static final boolean ALLOW_OVERRIDE_OVERRIDES = Boolean.getBoolean("modernfix.unsupported.allowOverriding"); + public static final boolean OPTIFINE_PRESENT; private File configFile; @@ -266,6 +268,9 @@ public class ModernFixEarlyConfig { } private void readProperties(Properties props) { + if(ALLOW_OVERRIDE_OVERRIDES) + LOGGER.fatal("JVM argument given to override mod overrides. Issues opened with this option present will be ignored unless they can be reproduced without."); + for (Map.Entry entry : props.entrySet()) { String key = (String) entry.getKey(); String value = (String) entry.getValue(); @@ -288,7 +293,7 @@ public class ModernFixEarlyConfig { continue; } - if(!option.isModDefined()) + if(ALLOW_OVERRIDE_OVERRIDES || !option.isModDefined()) option.setEnabled(enabled, true); else LOGGER.warn("Option '{}' already disabled by a mod. Ignoring user configuration", key);