diff --git a/common/src/main/java/org/embeddedt/modernfix/ModernFix.java b/common/src/main/java/org/embeddedt/modernfix/ModernFix.java index bb1bde3c..971d650e 100644 --- a/common/src/main/java/org/embeddedt/modernfix/ModernFix.java +++ b/common/src/main/java/org/embeddedt/modernfix/ModernFix.java @@ -70,7 +70,8 @@ public class ModernFix { public void onServerStarted() { if(ModernFixPlatformHooks.isDedicatedServer()) { float gameStartTime = ManagementFactory.getRuntimeMXBean().getUptime() / 1000f; - ModernFix.LOGGER.warn("Dedicated server took " + gameStartTime + " seconds to load"); + if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.measure_time.ServerLoad")) + ModernFix.LOGGER.warn("Dedicated server took " + gameStartTime + " seconds to load"); ModernFixPlatformHooks.onLaunchComplete(); } ClassInfoManager.clear(); diff --git a/common/src/main/java/org/embeddedt/modernfix/ModernFixClient.java b/common/src/main/java/org/embeddedt/modernfix/ModernFixClient.java index 6f556e46..18f4d9c9 100644 --- a/common/src/main/java/org/embeddedt/modernfix/ModernFixClient.java +++ b/common/src/main/java/org/embeddedt/modernfix/ModernFixClient.java @@ -71,7 +71,8 @@ public class ModernFixClient { worldLoadStartTime = System.nanoTime(); } else if (openingScreen instanceof TitleScreen && gameStartTimeSeconds < 0) { gameStartTimeSeconds = ManagementFactory.getRuntimeMXBean().getUptime() / 1000f; - ModernFix.LOGGER.warn("Game took " + gameStartTimeSeconds + " seconds to start"); + if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.measure_time.GameLoad")) + ModernFix.LOGGER.warn("Game took " + gameStartTimeSeconds + " seconds to start"); ModernFixPlatformHooks.onLaunchComplete(); ClassInfoManager.clear(); } @@ -92,8 +93,10 @@ public class ModernFixClient { && Minecraft.getInstance().player != null && numRenderTicks++ >= 10) { float timeSpentLoading = ((float)(System.nanoTime() - worldLoadStartTime) / 1000000000f); - ModernFix.LOGGER.warn("Time from main menu to in-game was " + timeSpentLoading + " seconds"); - ModernFix.LOGGER.warn("Total time to load game and open world was " + (timeSpentLoading + gameStartTimeSeconds) + " seconds"); + if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.measure_time.WorldLoad")) { + ModernFix.LOGGER.warn("Time from main menu to in-game was " + timeSpentLoading + " seconds"); + ModernFix.LOGGER.warn("Total time to load game and open world was " + (timeSpentLoading + gameStartTimeSeconds) + " seconds"); + } resetWorldLoadStateMachine(); } } diff --git a/common/src/main/java/org/embeddedt/modernfix/core/ModernFixMixinPlugin.java b/common/src/main/java/org/embeddedt/modernfix/core/ModernFixMixinPlugin.java index 850db8f2..c27995f1 100644 --- a/common/src/main/java/org/embeddedt/modernfix/core/ModernFixMixinPlugin.java +++ b/common/src/main/java/org/embeddedt/modernfix/core/ModernFixMixinPlugin.java @@ -34,6 +34,21 @@ public class ModernFixMixinPlugin implements IMixinConfigPlugin { this.logger.info("Loaded configuration file for ModernFix: {} options available, {} override(s) found", config.getOptionCount(), config.getOptionOverrideCount()); + config.getOptionMap().values().forEach(option -> { + if (option.isOverridden()) { + String source = "[unknown]"; + + if (option.isUserDefined()) { + source = "user configuration"; + } else if (option.isModDefined()) { + source = "mods [" + String.join(", ", option.getDefiningMods()) + "]"; + } + this.logger.warn("Option '{}' overriden (by {}) to '{}'", option.getName(), + source, option.isEnabled()); + } + }); + + if(ModernFixEarlyConfig.OPTIFINE_PRESENT) this.logger.fatal("OptiFine detected. Use of ModernFix with OptiFine is not supported due to its impact on launch time and breakage of Forge features."); @@ -87,24 +102,6 @@ public class ModernFixMixinPlugin implements IMixinConfigPlugin { return false; } - if (option.isOverridden()) { - String source = "[unknown]"; - - if (option.isUserDefined()) { - source = "user configuration"; - } else if (option.isModDefined()) { - source = "mods [" + String.join(", ", option.getDefiningMods()) + "]"; - } - - if (option.isEnabled()) { - this.logger.warn("Force-enabling mixin '{}' as rule '{}' (added by {}) enables it", mixin, - option.getName(), source); - } else { - this.logger.warn("Force-disabling mixin '{}' as rule '{}' (added by {}) disables it and children", mixin, - option.getName(), source); - } - } - return option.isEnabled(); } @Override