Minor bugfixes to faster singleplayer load
This commit is contained in:
parent
2b7d79f4a7
commit
145213afa8
|
|
@ -55,7 +55,7 @@ public class ModernFixClient {
|
|||
|
||||
@SubscribeEvent
|
||||
public void onRenderTickEnd(TickEvent.RenderTickEvent event) {
|
||||
if(event.phase == TickEvent.Phase.END && worldLoadStartTime != -1 && Minecraft.getInstance().player != null && numRenderTicks++ >= 10) {
|
||||
if(event.phase == TickEvent.Phase.END && !(Minecraft.getInstance().screen instanceof DeferredLevelLoadingScreen) && worldLoadStartTime != -1 && 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");
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import net.minecraft.network.chat.TranslatableComponent;
|
|||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import org.embeddedt.modernfix.screen.DeferredLevelLoadingScreen;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
|
@ -23,7 +24,8 @@ public class JEIUtil {
|
|||
|
||||
@SubscribeEvent
|
||||
public static void renderLoad(GuiScreenEvent.DrawScreenEvent.Post event) {
|
||||
if(isLoading.get()) {
|
||||
/* Don't show the JEI indicator on the level loading screen, that looks weird */
|
||||
if(isLoading.get() && !(event.getGui() instanceof DeferredLevelLoadingScreen)) {
|
||||
Gui.drawString(new PoseStack(), Minecraft.getInstance().font, new TranslatableComponent("modernfix.jei_load"), 0, 0, 0xffffff);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user