From a6048f22a211a8b2cce5148f25dde6cb0c9f6a71 Mon Sep 17 00:00:00 2001 From: asiekierka Date: Sun, 5 Apr 2015 11:52:33 +0200 Subject: [PATCH] fixes to render refreshing --- common/buildcraft/transport/TileGenericPipe.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/buildcraft/transport/TileGenericPipe.java b/common/buildcraft/transport/TileGenericPipe.java index e1ceef3a..364e5c16 100644 --- a/common/buildcraft/transport/TileGenericPipe.java +++ b/common/buildcraft/transport/TileGenericPipe.java @@ -530,6 +530,8 @@ public class TileGenericPipe extends TileEntity implements IFluidHandler, ((FacadePluggable) pluggable).setActiveState(activeState); } + /* TODO: Rewrite the requiresRenderUpdate API to run on the + server side instead of the client side to save network bandwidth */ pluggableState.setPluggables(sideProperties.pluggables); if (renderState.isDirty()) { @@ -1008,23 +1010,21 @@ public class TileGenericPipe extends TileEntity implements IFluidHandler, // mark for render update if necessary for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) { PipePluggable old = sideProperties.pluggables[i]; - PipePluggable newer = sideProperties.pluggables[i]; + PipePluggable newer = newPluggables[i]; if (old == null && newer == null) { continue; - } else if (old != null && newer != null) { + } else if (old != null && newer != null && old.getClass() == newer.getClass()) { if (newer.requiresRenderUpdate(old)) { worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); - System.out.println("Update requested - " + i); break; } } else { // one of them is null but not the other, so update worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); - System.out.println("Update requested [null] - " + i); break; } } - sideProperties.pluggables = newPluggables; + sideProperties.pluggables = newPluggables.clone(); for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) { final PipePluggable pluggable = getPipePluggable(ForgeDirection.getOrientation(i));