Added distance check to pipe render code limiting rendering to 32 blocks away.

This commit is contained in:
CovertJaguar 2012-07-19 19:02:33 -07:00
parent d6f5adac9e
commit 47eff20cb5

View file

@ -45,7 +45,9 @@ public class RenderPipe extends TileEntitySpecialRenderer {
final static private int maxPower = 1000;
final static private int displayLiquidStages = 40;
final static private int displayLiquidStages = 40;
final static private int renderDistanceSq = 1024; // 32 tiles
private final static EntityItem dummyEntityItem = new EntityItem(null);
@ -214,6 +216,9 @@ public class RenderPipe extends TileEntitySpecialRenderer {
if (BuildCraftCore.render == RenderMode.NoDynamic)
return;
if(tileentity.getDistanceFrom(tileEntityRenderer.playerX, tileEntityRenderer.playerY, tileEntityRenderer.playerZ) >= renderDistanceSq)
return;
initializeDisplayPowerList(tileentity.worldObj);