Program: 156968
Project: 156968
Buggy source:
private void refreshRenderState(){
  if (worldObj.isRemote)   return;
  for (  ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
    renderState.pipeConnectionMatrix.setConnected(o,this.pipeConnectionsBuffer[o.ordinal()]);
  }
  for (  ForgeDirection o : ForgeDirection.values()) {
    renderState.textureMatrix.setIconIndex(o,pipe.getIconIndex(o));
  }
  for (  IPipe.WireColor color : IPipe.WireColor.values()) {
    renderState.wireMatrix.setWire(color,pipe.wireSet[color.ordinal()]);
    for (    ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
      renderState.wireMatrix.setWireConnected(color,direction,pipe.isWireConnectedTo(this.getTile(direction),color));
    }
    boolean lit=pipe.signalStrength[color.ordinal()] > 0;
switch (color) {
case Red:
      renderState.wireMatrix.setWireIndex(color,lit ? WireIconProvider.Texture_Red_Lit : WireIconProvider.Texture_Red_Dark);
    break;
case Blue:
  renderState.wireMatrix.setWireIndex(color,lit ? WireIconProvider.Texture_Blue_Lit : WireIconProvider.Texture_Blue_Dark);
break;
case Green:
renderState.wireMatrix.setWireIndex(color,lit ? WireIconProvider.Texture_Green_Lit : WireIconProvider.Texture_Green_Dark);
break;
case Yellow:
renderState.wireMatrix.setWireIndex(color,lit ? WireIconProvider.Texture_Yellow_Lit : WireIconProvider.Texture_Yellow_Dark);
break;
default :
break;
}
}
renderState.setHasGate(pipe.hasGate());
renderState.setGateIconIndex(!pipe.hasGate() ? 0 : pipe.gate.getTextureIconIndex(pipe.isGateActive()));
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
int blockId=this.facadeBlocks[direction.ordinal()];
renderState.facadeMatrix.setFacade(direction,blockId,this.facadeMeta[direction.ordinal()]);
}
if (renderState.isDirty()) {
worldObj.markBlockForUpdate(this.xCoord,this.yCoord,this.zCoord);
renderState.clean();
}
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
renderState.plugMatrix.setConnected(direction,plugs[direction.ordinal()]);
}
}

Fixed version (ground truth):
private void refreshRenderState(){
  if (worldObj.isRemote)   return;
  for (  ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
    renderState.pipeConnectionMatrix.setConnected(o,this.pipeConnectionsBuffer[o.ordinal()]);
  }
  for (  ForgeDirection o : ForgeDirection.values()) {
    renderState.textureMatrix.setIconIndex(o,pipe.getIconIndex(o));
  }
  for (  IPipe.WireColor color : IPipe.WireColor.values()) {
    renderState.wireMatrix.setWire(color,pipe.wireSet[color.ordinal()]);
    for (    ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
      renderState.wireMatrix.setWireConnected(color,direction,pipe.isWireConnectedTo(this.getTile(direction),color));
    }
    boolean lit=pipe.signalStrength[color.ordinal()] > 0;
switch (color) {
case Red:
      renderState.wireMatrix.setWireIndex(color,lit ? WireIconProvider.Texture_Red_Lit : WireIconProvider.Texture_Red_Dark);
    break;
case Blue:
  renderState.wireMatrix.setWireIndex(color,lit ? WireIconProvider.Texture_Blue_Lit : WireIconProvider.Texture_Blue_Dark);
break;
case Green:
renderState.wireMatrix.setWireIndex(color,lit ? WireIconProvider.Texture_Green_Lit : WireIconProvider.Texture_Green_Dark);
break;
case Yellow:
renderState.wireMatrix.setWireIndex(color,lit ? WireIconProvider.Texture_Yellow_Lit : WireIconProvider.Texture_Yellow_Dark);
break;
default :
break;
}
}
renderState.setHasGate(pipe.hasGate());
renderState.setGateIconIndex(!pipe.hasGate() ? 0 : pipe.gate.getTextureIconIndex(pipe.isGateActive()));
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
int blockId=this.facadeBlocks[direction.ordinal()];
renderState.facadeMatrix.setFacade(direction,blockId,this.facadeMeta[direction.ordinal()]);
}
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
renderState.plugMatrix.setConnected(direction,plugs[direction.ordinal()]);
}
if (renderState.isDirty()) {
worldObj.markBlockForUpdate(this.xCoord,this.yCoord,this.zCoord);
renderState.clean();
}
}