neoforged / NeoForge

Neo Modding API for Minecraft, based on Forge
https://projects.neoforged.net/neoforged/neoforge
Other
1.17k stars 172 forks source link

[1.20.2+] `CustomizeGuiOverlayEvent$DebugText` no longer allows for modifying existing debug information as it fires on empty lists which are appended only after vanilla #1065

Closed Fuzss closed 2 months ago

Fuzss commented 4 months ago

CustomizeGuiOverlayEvent$DebugText according to the Javadoc is intended to allow for the addition and removal of text information on the debug screen.

As of 1.20.2+ though the event no longer provides the already gathered debug text lists, but instead provides empty lists which are appended after vanilla information. This makes it impossible to remove vanilla debug information and to append custom information anywhere but after vanilla.

The current patch can be found here: https://github.com/neoforged/NeoForge/blob/1.20.x/patches/net/minecraft/client/gui/components/DebugScreenOverlay.java.patch

Ideally the event should be patched in twice, in DebugScreenOverlay::drawGameInformation and in DebugScreenOverlay::drawSystemInformation just before the text is drawn on the screen via DebugScreenOverlay::renderLines, providing the text lists with all the gathered debug information. This would restore the exact behavior as it was in 1.20.1.

Fuzss commented 4 months ago

If the event behavior was changed intentionally to only allow for appending debug information after vanilla it would be great if the Javadoc could at least reflect that.