Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.21] Registering too many GUI layers causes some to be invisible #1400

Closed
embeddedt opened this issue Jul 31, 2024 · 2 comments · Fixed by #1404
Closed

[1.21] Registering too many GUI layers causes some to be invisible #1400

embeddedt opened this issue Jul 31, 2024 · 2 comments · Fixed by #1404
Labels
1.21 Targeted at Minecraft 1.21 bug A bug or error

Comments

@embeddedt
Copy link
Member

Minecraft Version: 1.21

NeoForge Version: 21.0.112-beta

Description of issue:

Presumably due to the LayeredDraw system using a fixed Z separation of 200 units between layers, adding enough layers causes the top ones to become invisible.

To reproduce, add a loop like below to any mod that renders a custom GUI layer and run it standalone. The modded layer will be invisible.

private void onRegisterGuiLayers(RegisterGuiLayersEvent event) {
    // Register some placeholder layers
    for(int i = 0; i < 50; i++) {
        event.registerAboveAll(ResourceLocation.fromNamespaceAndPath(MOD_ID, "fake_" + i), new LayeredDraw.Layer() {
            @Override
	    public void render(GuiGraphics guiGraphics, DeltaTracker deltaTracker) {
					
	    }
        });
    }
    // Register the real layer
    event.registerAboveAll(ResourceLocation.fromNamespaceAndPath(MOD_ID, "hud"), new ModdedHUDRenderLayer());
}
@KyBeeS
Copy link

KyBeeS commented Aug 30, 2024

Issue is occurring again in current release of all the mods 10. We're having issues reproducing it with other mod combinations and it's seemingly random. Seems it may be a neoforge issue but we're not sure

@XFactHD
Copy link
Member

XFactHD commented Aug 30, 2024

I can reproduce the issue in both ATM10 and a dev environment. I have opened a separate issue for it, see #1504 for more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21 Targeted at Minecraft 1.21 bug A bug or error
Projects
None yet
3 participants