-
Notifications
You must be signed in to change notification settings - Fork 405
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
Add Hud Render Events #4119
base: 1.21.1
Are you sure you want to change the base?
Add Hud Render Events #4119
Conversation
...endering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/HudRenderEvents.java
Outdated
Show resolved
Hide resolved
...endering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/HudRenderEvents.java
Show resolved
Hide resolved
...endering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/HudRenderEvents.java
Show resolved
Hide resolved
...1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/HudRenderEventsTests.java
Outdated
Show resolved
Hide resolved
...endering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/HudRenderEvents.java
Outdated
Show resolved
Hide resolved
Not sure this really goes far enough. The system used by NeoForge has always been pretty ideal (although quite invasive): splitting gui rendering into all the different parts (health, hotbar, status effects, etc.) and allowing mods to render their custom gui layers anywhere in-between. Also it would be awesome to finally get shared height parameters for bars (health bar + armor bar on the left side, food + air on the right side) rendered above the hotbar in Fabric Api. So that multiple mods adding their own bars know at what height to render without interfering with others. |
I agree that Forge's implementation (last when I saw it) is much more versatile and comprehensive. It would be great to be able to cancel certain components too. However as you mentioned it is quite invasive, and in the past, this injection point hasn't exactly been the most stable. A more comprehensive api would need a bit more discussion with the maintainers, but I'd be happy to see it.
The height problem is just reading the code to see the height where bars and components render right? Are you suggesting we provide z constants for different HUD elements? |
No. NeoForge adds |
@FunctionalInterface | ||
public interface HudRenderStage { | ||
/** | ||
* Called sometime during a specific HUD render stage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Called sometime during a specific HUD render stage. | |
* Called during a HUD render stage. |
Deprecate
HudRenderCallback
.