Added a null check in PipeRender

Catches non-existant liquids, but I expect it will still crash elsewhere
if the liquid doesn't exist.
This commit is contained in:
CovertJaguar 2012-11-30 15:00:58 -08:00
parent dd279689a8
commit 198fa9b7ed

View file

@ -368,7 +368,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
}
public DisplayLiquidList getListFromBuffer(LiquidStack stack, World world) {
private DisplayLiquidList getListFromBuffer(LiquidStack stack, World world) {
int liquidId = stack.itemID;
@ -377,9 +377,11 @@ public class RenderPipe extends TileEntitySpecialRenderer {
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
ForgeHooksClient.bindTexture(Block.blocksList[liquidId].getTextureFile(), 0);
} else {
} else if(Item.itemsList[liquidId] != null) {
ForgeHooksClient.bindTexture(Item.itemsList[liquidId].getTextureFile(), 0);
}
} else {
return null;
}
return getDisplayLiquidLists(liquidId, stack.itemMeta, world);
}