Skip to content

Add Sky Rendering Events#5328

Open
lowercasebtw wants to merge 14 commits intoFabricMC:26.1.2from
lowercasebtw:26.1.2
Open

Add Sky Rendering Events#5328
lowercasebtw wants to merge 14 commits intoFabricMC:26.1.2from
lowercasebtw:26.1.2

Conversation

@lowercasebtw
Copy link
Copy Markdown

@lowercasebtw lowercasebtw commented Apr 15, 2026

This will be my first contribution to Fabric API. Had to rework some events from my original to work w/ fabric-api's ecosystem and how it handles events.

Events for each portion of the sky rendering, with corresponding important data accessible during those phases. Allowing cancelling of rendering such as the stars/sun/moon.

Also adds a custom element even in which although unused by FAPI, is intended for mod developers to invoke when adding custom elements to the sky when rendering allowing other mods to intercept them and do as please.

Progress:
Everything is implemented, only needs testing & javadoc work now.

Question:
Should the status of if the pre-event was cancelled be passed along to the post-event? Should the post event even be called if the pre-event was cancelled?

@sylv256 sylv256 added enhancement New feature or request area: rendering labels Apr 15, 2026
@lowercasebtw lowercasebtw marked this pull request as ready for review April 15, 2026 19:39
@lowercasebtw lowercasebtw changed the title DRAFT: Add Sky Rendering Events Add Sky Rendering Events Apr 15, 2026
InvalidateRenderStateCallback.EVENT.invoker().onInvalidate();
}

@Inject(method = "lambda$addSkyPass$0", at = @At("HEAD"), cancellable = true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Injecting into lambdas is rather brittle (especially on unobf), could we instead compose the lambda or wrap the pass.executes?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you wrap the pass.executes itll call the code before it should I think and its working fine currently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: rendering enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants