Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Description
Follow-up to #6662. With durability on Total or Percentage the numbers are drawn now, but with
the custom font on (the default) they end up underneath the armor icons, so you only see the
parts that stick out past the item.
The text is drawn from the post task with
TextRenderer.get(). With the custom font that isCustomTextRenderer, and itsend()draws the mesh straight away, inside the 2D event. Theitems from
renderer.item()only go into the gui render state and are drawn after the event byguiRenderer.render()inGuiRendererMixin, so anything the custom font draws over a hud itemgets covered by it.
VanillaTextRenderergoes throughgraphics.text(), which is queued together with the items anddrawn above them, the same way the vanilla stack count is. Using it for the durability text puts
the numbers on top. The trade-off is that these numbers always use the vanilla font, and since
VanillaTextRendereralways draws a shadow,durability-shadowonly does something with thecustom font off. Keeping the custom font here would need a way to draw it after the gui render
pass, which felt like too much for this.
Related issues
#6576, #6662
How Has This Been Tested?
Singleplayer on 26.3, creative, wearing a damaged diamond helmet, elytra, netherite leggings and
gold boots with durability on Percentage. Before, the numbers were mostly hidden behind the icons.
After, they read 45 / 31 / 91 / 100 on top of them. Also tried Total with Vertical orientation and
the hud custom font off, no begin/end errors. Ran it both from the dev environment and as a jar
in a normal install.
Checklist: