Skip to content

Commit

Permalink
Disable immediate loading screen closure by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Nov 26, 2024
1 parent 6f96207 commit 7ac44e3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,21 @@ public static final class BugFixes {
)
public boolean fixMC159283 = false;
}

@Serializable
public Misc misc = new Misc();

@Adaptable
public static final class Misc {

@Serializable(
serializedKey = "immediately-close-loading-screen",
comment = """
Whether the loading screen should be closed immediately when joining servers/SP worlds.
This will let you in game faster, but may result in getting in game before enough chunks are
loaded for rendering.
"""
)
public boolean immediatelyCloseLoadingScreen = false;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ca.spottedleaf.moonrise.mixin.loading_screen;

import ca.spottedleaf.moonrise.common.util.ConfigHolder;
import net.minecraft.client.multiplayer.LevelLoadStatusManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -25,6 +26,9 @@ abstract class LevelLoadStatusManagerMixin {
)
)
private void immediatelyClose(final CallbackInfo ci) {
if (!ConfigHolder.getConfig().misc.immediatelyCloseLoadingScreen) {
return;
}
if (this.status == LevelLoadStatusManager.Status.WAITING_FOR_SERVER) {
this.status = LevelLoadStatusManager.Status.LEVEL_READY;
ci.cancel();
Expand Down

0 comments on commit 7ac44e3

Please sign in to comment.