Mojira Archive
MC-121516

Some generated item models have 'missing' edges

The bug

"3D texture" item models currently have issues when generated for some textures with translucency.
In particular, they appear to have missing side edges, as can be seen in the provided screenshot. (The texture used for this example is also provided)

Code analysis

These models are generated by the ItemModelGenerator class. This has a function isTransparent, which considers a pixel to be transparent if it has an alpha value of 0:

return (p_178391_1_[p_178391_3_ * p_178391_4_ + p_178391_2_] >> 24 & 255) == 0;

However, the RenderItem class used for rendering the items uses the following for alpha testing:

GlStateManager.alphaFunc(516, 0.1F);

(516 being the value of GL11.GL_GREATER), which means only item model parts with an alpha value > 0.1 will be rendered.

The transparency handling should be made consistent between these two places to prevent these issues.