End tank rendering if contained liquid does not exist. Closes #227

This commit is contained in:
SirSengir 2012-09-09 12:14:35 +02:00
parent 585095b0c2
commit 30aef0704c

View file

@ -44,8 +44,10 @@ public class RenderTank extends TileEntitySpecialRenderer {
BlockInterface block = new BlockInterface();
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null)
block.texture = Block.blocksList[liquidId].blockIndexInTexture;
else
else if(Item.itemsList[liquidId] != null)
block.texture = Item.itemsList[liquidId].getIconFromDamage(damage);
else
return null;
for (int s = 0; s < displayStages; ++s) {
d[s] = GLAllocation.generateDisplayLists(1);
@ -79,6 +81,8 @@ public class RenderTank extends TileEntitySpecialRenderer {
return;
int[] displayList = getDisplayLists(liquid.itemID, liquid.itemMeta, tileentity.worldObj);
if(displayList == null)
return;
GL11.glPushMatrix();
GL11.glDisable(2896 /* GL_LIGHTING */);