Merge pull request #3130 from iTitus/fix-3128

Fix #3128
This commit is contained in:
Adrian Siekierka 2015-11-15 21:04:33 +01:00
commit e2af94bcb4

View file

@ -30,11 +30,18 @@ public class RenderTank extends TileEntitySpecialRenderer {
TileTank tank = (TileTank) CoreProxy.proxy.getServerTile(tileentity);
FluidStack liquid = tank.tank.getFluid();
int color = tank.tank.colorRenderCache;
if (liquid == null || liquid.amount <= 0) {
if (liquid == null || liquid.getFluid() == null || liquid.amount <= 0) {
return;
}
// Workaround: The colorRenderCache from the server tile from getServerTile(...) does not get synced properly
int color;
if(tank.getWorldObj().isRemote) {
color = tank.tank.colorRenderCache;
} else {
color = liquid.getFluid().getColor(liquid);
}
int[] displayList = FluidRenderer.getFluidDisplayLists(liquid, tileentity.getWorldObj(), false);
if (displayList == null) {
return;