Delay the initial setScreen call.#747
Open
Acuadragon100 wants to merge 2 commits intoKiltMC:version/1.20.1from
Open
Delay the initial setScreen call.#747Acuadragon100 wants to merge 2 commits intoKiltMC:version/1.20.1from
Acuadragon100 wants to merge 2 commits intoKiltMC:version/1.20.1from
Conversation
…nt to display a custom menu screen.
BluSpring
requested changes
Apr 28, 2026
| // Use lower priority for screen delay. This gives priority to Fabric mods, | ||
| // allowing them to set their menu screen without interference from the Forge event. | ||
| @Mixin(value = Minecraft.class, priority = 500) | ||
| public static class Early { |
Member
There was a problem hiding this comment.
I would prefer for this to be brought into Kilt's own mixin classes rather than the injects package. Prefer the name to stay as MinecraftMixin, following a convention for the mixin package, maybe under mixin.workarounds.early_screen_delay?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some Forge mods like Aether and Aether addons like to replace the menu screen using the opening screen event.
Only problem is that on Fabric the screen is set before the mods are initialized, which means they never receive the first screen opening event. On Forge, the game is patched to move this code into the end of
method_29338(the lambda inside the constructor of Minecraft that runs after the loading overlay is done). So I basically just replicated this with mixins that store the setScreen call in a variable until the forge mods have been initialized and runs it then. I specifically chose to put this in a separate mixin with a lower priority so that any Fabric mods wrapping the setScreen function calls with@WrapOperationwill still run at the original time.