mojira.dev
MC-5232

Unnecessary null-check in Item Rendering code

File: Seargename "RenderItem", Notchname "bce"
Method Signature: a(LEntityItem;IIFFFF)V
At Obfuscated Source File Line 176
At MCP Source File Line 246
Near:
```
GL11.glTranslatef(0.0F, 0.0F, var16 + var17);
if (Block.blocksList[var18.itemID] != null)
{
this.loadTexture("/terrain.png");
}
else
```
Var18 is the item contained in the EntityItem.
There are no bounds-checks on this statement to check if var18.itemID will fit into that array. Even though it seems like this is not crashing the game yet, it's possible that that statement could generate an ArrayIndexOutOfBounds exception in certain cases, like a 4096-block fix.

To be honest, I have no clue how this doesn't cause an exception when you drop an item :s

A better way would be to check the item array and do instanceof.

Comments 2

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

No answer on querry, assuming not an issue anymore.

Riking (Kane York)

(Unassigned)

Unconfirmed

code

Minecraft 1.4.6

Retrieved