Skip to content

Commit f27d6e1

Browse files
committed
Make disabling feature.measure_time also disable game/world load messages
1 parent 1c0fca8 commit f27d6e1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
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
@@ -65,7 +65,8 @@ public void onScreenOpening(Screen openingScreen) {
6565
worldLoadStartTime = System.nanoTime();
6666
} else if (openingScreen instanceof TitleScreen && gameStartTimeSeconds < 0) {
6767
gameStartTimeSeconds = ManagementFactory.getRuntimeMXBean().getUptime() / 1000f;
68-
ModernFix.LOGGER.warn("Game took " + gameStartTimeSeconds + " seconds to start");
68+
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.measure_time.GameLoad"))
69+
ModernFix.LOGGER.warn("Game took " + gameStartTimeSeconds + " seconds to start");
6970
ModernFixPlatformHooks.onLaunchComplete();
7071
ClassInfoManager.clear();
7172
}
@@ -86,8 +87,10 @@ public void onRenderTickEnd() {
8687
&& Minecraft.getInstance().player != null
8788
&& numRenderTicks++ >= 10) {
8889
float timeSpentLoading = ((float)(System.nanoTime() - worldLoadStartTime) / 1000000000f);
89-
ModernFix.LOGGER.warn("Time from main menu to in-game was " + timeSpentLoading + " seconds");
90-
ModernFix.LOGGER.warn("Total time to load game and open world was " + (timeSpentLoading + gameStartTimeSeconds) + " seconds");
90+
if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.measure_time.WorldLoad")) {
91+
ModernFix.LOGGER.warn("Time from main menu to in-game was " + timeSpentLoading + " seconds");
92+
ModernFix.LOGGER.warn("Total time to load game and open world was " + (timeSpentLoading + gameStartTimeSeconds) + " seconds");
93+
}
9194
resetWorldLoadStateMachine();
9295
}
9396
}

0 commit comments

Comments
 (0)