File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
common/src/main/java/org/embeddedt/modernfix Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff 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 ();
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments