Skip to content

Commit 8fd31f3

Browse files
committed
Merge 1.16 into 1.18
2 parents b99e253 + f3a2ca7 commit 8fd31f3

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

common/src/main/java/org/embeddedt/modernfix/ModernFix.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public void run() {
7070
public void onServerStarted() {
7171
if(ModernFixPlatformHooks.isDedicatedServer()) {
7272
float gameStartTime = ManagementFactory.getRuntimeMXBean().getUptime() / 1000f;
73-
ModernFix.LOGGER.warn("Dedicated server took " + gameStartTime + " seconds to load");
73+
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.measure_time.ServerLoad"))
74+
ModernFix.LOGGER.warn("Dedicated server took " + gameStartTime + " seconds to load");
7475
ModernFixPlatformHooks.onLaunchComplete();
7576
}
7677
ClassInfoManager.clear();

common/src/main/java/org/embeddedt/modernfix/ModernFixClient.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public void onScreenOpening(Screen openingScreen) {
7171
worldLoadStartTime = System.nanoTime();
7272
} else if (openingScreen instanceof TitleScreen && gameStartTimeSeconds < 0) {
7373
gameStartTimeSeconds = ManagementFactory.getRuntimeMXBean().getUptime() / 1000f;
74-
ModernFix.LOGGER.warn("Game took " + gameStartTimeSeconds + " seconds to start");
74+
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.measure_time.GameLoad"))
75+
ModernFix.LOGGER.warn("Game took " + gameStartTimeSeconds + " seconds to start");
7576
ModernFixPlatformHooks.onLaunchComplete();
7677
ClassInfoManager.clear();
7778
}
@@ -92,8 +93,10 @@ public void onRenderTickEnd() {
9293
&& Minecraft.getInstance().player != null
9394
&& numRenderTicks++ >= 10) {
9495
float timeSpentLoading = ((float)(System.nanoTime() - worldLoadStartTime) / 1000000000f);
95-
ModernFix.LOGGER.warn("Time from main menu to in-game was " + timeSpentLoading + " seconds");
96-
ModernFix.LOGGER.warn("Total time to load game and open world was " + (timeSpentLoading + gameStartTimeSeconds) + " seconds");
96+
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.measure_time.WorldLoad")) {
97+
ModernFix.LOGGER.warn("Time from main menu to in-game was " + timeSpentLoading + " seconds");
98+
ModernFix.LOGGER.warn("Total time to load game and open world was " + (timeSpentLoading + gameStartTimeSeconds) + " seconds");
99+
}
97100
resetWorldLoadStateMachine();
98101
}
99102
}

common/src/main/java/org/embeddedt/modernfix/core/ModernFixMixinPlugin.java

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ public ModernFixMixinPlugin() {
3434
this.logger.info("Loaded configuration file for ModernFix: {} options available, {} override(s) found",
3535
config.getOptionCount(), config.getOptionOverrideCount());
3636

37+
config.getOptionMap().values().forEach(option -> {
38+
if (option.isOverridden()) {
39+
String source = "[unknown]";
40+
41+
if (option.isUserDefined()) {
42+
source = "user configuration";
43+
} else if (option.isModDefined()) {
44+
source = "mods [" + String.join(", ", option.getDefiningMods()) + "]";
45+
}
46+
this.logger.warn("Option '{}' overriden (by {}) to '{}'", option.getName(),
47+
source, option.isEnabled());
48+
}
49+
});
50+
51+
3752
if(ModernFixEarlyConfig.OPTIFINE_PRESENT)
3853
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.");
3954

@@ -87,24 +102,6 @@ public boolean isOptionEnabled(String mixin) {
87102
return false;
88103
}
89104

90-
if (option.isOverridden()) {
91-
String source = "[unknown]";
92-
93-
if (option.isUserDefined()) {
94-
source = "user configuration";
95-
} else if (option.isModDefined()) {
96-
source = "mods [" + String.join(", ", option.getDefiningMods()) + "]";
97-
}
98-
99-
if (option.isEnabled()) {
100-
this.logger.warn("Force-enabling mixin '{}' as rule '{}' (added by {}) enables it", mixin,
101-
option.getName(), source);
102-
} else {
103-
this.logger.warn("Force-disabling mixin '{}' as rule '{}' (added by {}) disables it and children", mixin,
104-
option.getName(), source);
105-
}
106-
}
107-
108105
return option.isEnabled();
109106
}
110107
@Override

0 commit comments

Comments
 (0)