Skip to content

Fix Duplicated Revive HUD Rendering on NeoForge 26.2 - #212

Open
xAlamaos wants to merge 1 commit into
CreativeMD:26.xfrom
xAlamaos:playerrevive-hud-fix-clean
Open

Fix Duplicated Revive HUD Rendering on NeoForge 26.2#212
xAlamaos wants to merge 1 commit into
CreativeMD:26.xfrom
xAlamaos:playerrevive-hud-fix-clean

Conversation

@xAlamaos

Copy link
Copy Markdown

Summary

Fixes duplicated PlayerRevive HUD rendering on NeoForge 26.2 by changing the GUI render event used by ReviveEventClient.

Previously, the revive HUD was rendered using RenderGuiLayerEvent.Post. Because this event is fired after individual GUI layers, the PlayerRevive HUD could be rendered multiple times during the same frame.

This resulted in duplicated on-screen revive information while bleeding, including the revive progress, time remaining, give-up prompt, and self-revive prompt when self-revive was enabled.

Changing the handler to RenderGuiEvent.Post moves the PlayerRevive HUD rendering to the post-GUI event, preventing the revive overlay from being rendered multiple times per frame.

Change

Changed:

import net.neoforged.neoforge.client.event.RenderGuiLayerEvent;

to:

import net.neoforged.neoforge.client.event.RenderGuiEvent;

and changed:

public void tick(RenderGuiLayerEvent.Post event)

to:

public void tick(RenderGuiEvent.Post event)

No revive mechanics, configuration values, self-revive behavior, revive progress, or bleeding logic were otherwise changed.

Testing

Tested on NeoForge 26.2 in the modpack where the duplicated rendering was originally reproduced.

Runtime testing:

  • PlayerRevive loads normally
  • Entering the bleeding/downed state works normally
  • Revive HUD renders correctly
  • Revive progress and remaining time display correctly
  • Give-up prompt displays correctly
  • Self-revive prompt displays correctly when self-revive is enabled
  • The duplicated HUD rendering no longer occurs

Scope

The fix only changes the NeoForge GUI event used to render the existing PlayerRevive HUD.

It does not modify the revive system itself, self-revive mechanics, configuration values, or gameplay behavior. The change is limited to preventing the existing HUD rendering code from being invoked multiple times during GUI rendering.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant