From 47eff20cb59f685499ecd20896c2dfd94aa8e1d9 Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Thu, 19 Jul 2012 19:02:33 -0700 Subject: [PATCH] Added distance check to pipe render code limiting rendering to 32 blocks away. --- .../net/minecraft/src/buildcraft/transport/RenderPipe.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/buildcraft_client/net/minecraft/src/buildcraft/transport/RenderPipe.java b/buildcraft_client/net/minecraft/src/buildcraft/transport/RenderPipe.java index f77aeab6..54ca0d7d 100644 --- a/buildcraft_client/net/minecraft/src/buildcraft/transport/RenderPipe.java +++ b/buildcraft_client/net/minecraft/src/buildcraft/transport/RenderPipe.java @@ -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);