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 2036f880..ddbf0f7b 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 @@ -11,6 +11,7 @@ import org.embeddedt.modernfix.ModernFix; import org.embeddedt.modernfix.annotation.ClientOnlyMixin; import org.embeddedt.modernfix.annotation.IgnoreOutsideDev; import org.embeddedt.modernfix.annotation.RequiresMod; +import org.embeddedt.modernfix.core.ModernFixMixinPlugin; import org.embeddedt.modernfix.platform.ModernFixPlatformHooks; import org.objectweb.asm.ClassReader; import org.objectweb.asm.Type; @@ -253,6 +254,17 @@ public class ModernFixEarlyConfig { } } + private void readJVMProperties() { + for(String optionKey : this.options.keySet()) { + String value = System.getProperty("modernfix.config." + optionKey); + if(value == null || value.length() == 0) + continue; + boolean isEnabled = Boolean.valueOf(value); + ModernFixMixinPlugin.instance.logger.info("Configured {} to '{}' via JVM property.", optionKey, isEnabled); + this.options.get(optionKey).setEnabled(isEnabled, true); + } + } + 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."); @@ -341,6 +353,8 @@ public class ModernFixEarlyConfig { } catch (IOException e) { LOGGER.warn("Could not write configuration file", e); } + + config.readJVMProperties(); } return config; diff --git a/fabric/testmod/build.gradle b/fabric/testmod/build.gradle index 8e27f9b9..e7f14c44 100644 --- a/fabric/testmod/build.gradle +++ b/fabric/testmod/build.gradle @@ -2,6 +2,13 @@ apply plugin: "dev.architectury.loom" loom { accessWidenerPath = project(":common").loom.accessWidenerPath + runs { + client { + property("modernfix.config.mixin.perf.blast_search_trees", "true") + property("modernfix.config.mixin.perf.dynamic_resources", "true") + property("modernfix.config.mixin.perf.dynamic_block_codecs", "true") + } + } } dependencies {