mojira.dev
MC-80110

Villager item count graphical bug

The bug

When you move an item from your inventory in the trading menu of a villager to a spot where an item is displayed:

  • The count of the displayed item gets displayed in front of your item

  • The count of your item get displayed behind the displayed item

The reason

The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

The reason for this is that the method net.minecraft.client.renderer.RenderItem.renderItemOverlayIntoGUI(FontRenderer, ItemStack, int, int, String) always disables depth before drawing the item count. This way it is always drawn "on top" of everything. The problem is that GUIs that extend GuiContainer always draw after the container itself is drawn. As the GuiContainer class also draws the item picked up with the mouse, the item count drawn by the villager GUI is on top of it.
This could (and maybe should) be solved by having the method net.minecraft.client.renderer.RenderItem.renderItemOverlayIntoGUI(FontRenderer, ItemStack, int, int, String) use like it is done for drawing the items use a z-level as well to determine the depth.

Linked issues

Attachments

Comments 4

Is this still an issue in the latest snapshot 16w44a? If so please update the affected versions.

This is an automated comment on any open or reopened issue with out-of-date affected versions.

Relates to MC-145869

Can partially reproduce in 1.17.1. The red line caused by discounts renders on top of the held item.

This issue was fixed in 19w41a, along with [MC-121942]. The issue described by @unknown is a different one.

marcono1234

(Unassigned)

Confirmed

Platform

Low

UI

trading, villager

Minecraft 1.8.4, Minecraft 15w44b, Minecraft 1.9.3 Pre-Release 1, Minecraft 16w32b, Minecraft 1.11.2, ..., Minecraft 1.14.2, Minecraft 1.14.3 Pre-Release 3, Minecraft 1.14.3 Pre-Release 4, 1.15.1, 1.17.1

19w41a

Retrieved