Jump to content

1.15.2 IngameGui override


KurodaAkira

Recommended Posts

With 1.15.2 the variable "ingameGui" in the Minecraft class is now final.
Unfortunately my mod works by changing this variable to a custom IngameGui.
I tried working with the RenderGameOverlayEvent but without outright cancelling all other events this doesn't work.
Is there a way to override the ForgeIngameGui class or a way to replace it's renderGameOverlay method?

Link to comment
Share on other sites

The mod I am working on replaces most of the HUD.
The way it does it allows to render them with a few options which by their nature need to happen before the event gets triggered since they affect the event.
Maybe this has changed but I haven't found out about it.
The mod requires the elements in question to be able to render even if the render event gets canceled by another mod and at the same time prevent the rendering of the vanilla elements while still firing the event for other mods to use (the user can change the behavior via the settings to adjust for other mods using the events).
Can I stop the vanilla rendering from happening while still letting the event fire normally?
Can I render elements while the respective event is canceled?

An example for this was with Tinker's Construct in 1.12.
Tinker's rendered the health via the event but canceled the event.
If you were using my mod this would make the HUD look really weird (if it used events). Instead you could disable the event trigger (and the health rendering of tinkers by doing this) and force the health render of my mod without an event.

At the same time this allowed me to use protected variables of GuiIngame which some of the elements needed (overlayMessageTime for example) and adjust things of sub.gui elements (for example the BossOverlayGui) without breaking any compatibility with other mods which called them.

Edited by KurodaAkira
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.