Program: 156830
Project: 156830
Buggy source:
@Override public void updateEntity(){
  if (container.getWorldObj().isRemote) {
    for (int i=0; i < 6; i+=2) {
      movementStage[i / 2]=(movementStage[i / 2] + 0.01F) % 1.0F;
    }
    return;
  }
  step();
  init();
  System.arraycopy(displayPower,0,prevDisplayPower,0,6);
  Arrays.fill(displayPower,(short)0);
  int totalPowerContained=0;
  for (int in=0; in < 6; ++in) {
    totalPowerContained+=internalPower[in];
  }
  int totalPowerQuery=0;
  for (int out=0; out < 6; ++out) {
    if (internalPower[out] == 0) {
      totalPowerQuery+=powerQuery[out];
    }
  }
  int totalPowerConsumed=0;
  if (totalPowerContained > 0) {
    for (int out=0; out < 6; ++out) {
      externalPower[out]=0;
      if (powerQuery[out] > 0 && internalPower[out] == 0) {
        int powerConsumed=(int)Math.round((double)(powerQuery[out] * totalPowerContained) / totalPowerQuery);
        boolean tilePowered=false;
        if (tiles[out] instanceof TileGenericPipe) {
          TileGenericPipe nearbyTile=(TileGenericPipe)tiles[out];
          PipeTransportPower nearbyTransport=(PipeTransportPower)nearbyTile.pipe.transport;
          powerConsumed=nearbyTransport.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[out].getOpposite(),powerConsumed);
          tilePowered=true;
        }
 else         if (tiles[out] instanceof IEnergyHandler) {
          IEnergyHandler handler=(IEnergyHandler)tiles[out];
          if (handler.canConnectEnergy(ForgeDirection.VALID_DIRECTIONS[out].getOpposite())) {
            powerConsumed=handler.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[out].getOpposite(),powerConsumed,false);
            tilePowered=true;
          }
        }
 else {
          PowerReceiver prov=getReceiverOnSide(ForgeDirection.VALID_DIRECTIONS[out]);
          if (prov != null) {
            powerConsumed=(int)Math.ceil(prov.receiveEnergy(Type.PIPE,(double)powerConsumed / 10.0,ForgeDirection.VALID_DIRECTIONS[out].getOpposite()) * 10);
            tilePowered=true;
          }
        }
        if (!tilePowered) {
          externalPower[out]=powerConsumed;
        }
        displayPower[out]+=powerConsumed;
        totalPowerConsumed+=powerConsumed;
      }
    }
  }
  if (totalPowerConsumed > 0) {
    for (int in=0; in < 6; ++in) {
      int powerConsumed=(int)Math.round(internalPower[in] / totalPowerContained * totalPowerConsumed);
      displayPower[in]+=powerConsumed;
    }
  }
  highestPower=0;
  for (int i=0; i < 6; i++) {
    displayPower[i]=(short)((prevDisplayPower[i] * (DISPLAY_SMOOTHING - 1.0F) + displayPower[i]) / DISPLAY_SMOOTHING);
    if (displayPower[i] > highestPower) {
      highestPower=displayPower[i];
    }
    if (displayPower[i] < 0.01) {
      displayPower[i]=0;
    }
  }
  overload+=highestPower > maxPower * 0.95 ? 1 : -1;
  if (overload < 0) {
    overload=0;
  }
  if (overload > OVERLOAD_TICKS) {
    overload=OVERLOAD_TICKS;
  }
  for (  ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
    TileEntity tile=tiles[dir.ordinal()];
    if (tile instanceof IEnergyHandler) {
      IEnergyHandler handler=(IEnergyHandler)tile;
      if (handler.canConnectEnergy(dir.getOpposite())) {
        int request=handler.receiveEnergy(dir.getOpposite(),this.maxPower,true);
        if (request > 0) {
          requestEnergy(dir,request);
        }
      }
    }
 else     if (!(tile instanceof TileGenericPipe && ((TileGenericPipe)tile).pipe.transport instanceof PipeTransportPower)) {
      PowerReceiver prov=getReceiverOnSide(dir);
      if (prov != null) {
        int request=(int)Math.floor(prov.powerRequest() * 10);
        if (request > 0) {
          requestEnergy(dir,request);
        }
      }
    }
  }
  int[] transferQuery=new int[6];
  for (int i=0; i < 6; ++i) {
    transferQuery[i]=0;
    for (int j=0; j < 6; ++j) {
      if (j != i) {
        transferQuery[i]+=powerQuery[j];
      }
    }
    transferQuery[i]=Math.min(transferQuery[i],maxPower);
  }
  for (int i=0; i < 6; ++i) {
    if (transferQuery[i] != 0) {
      if (tiles[i] != null) {
        TileEntity entity=tiles[i];
        if (entity instanceof TileGenericPipe) {
          TileGenericPipe nearbyTile=(TileGenericPipe)entity;
          if (nearbyTile.pipe == null) {
            continue;
          }
          PipeTransportPower nearbyTransport=(PipeTransportPower)nearbyTile.pipe.transport;
          nearbyTransport.requestEnergy(ForgeDirection.VALID_DIRECTIONS[i].getOpposite(),transferQuery[i]);
        }
      }
    }
  }
  if (tracker.markTimeIfDelay(container.getWorldObj())) {
    PacketPowerUpdate packet=new PacketPowerUpdate(container.xCoord,container.yCoord,container.zCoord);
    packet.displayPower=displayPower;
    packet.overload=isOverloaded();
    BuildCraftTransport.instance.sendToPlayers(packet,container.getWorldObj(),container.xCoord,container.yCoord,container.zCoord,DefaultProps.PIPE_CONTENTS_RENDER_DIST);
  }
}

Fixed version (ground truth):
@Override public void updateEntity(){
  if (container.getWorldObj().isRemote) {
    for (int i=0; i < 6; i+=2) {
      movementStage[i / 2]=(movementStage[i / 2] + 0.01F) % 1.0F;
    }
    return;
  }
  step();
  init();
  System.arraycopy(displayPower,0,prevDisplayPower,0,6);
  Arrays.fill(displayPower,(short)0);
  int totalPowerContained=0;
  for (int in=0; in < 6; ++in) {
    totalPowerContained+=internalPower[in];
  }
  int totalPowerQuery=0;
  for (int out=0; out < 6; ++out) {
    if (internalPower[out] == 0) {
      totalPowerQuery+=powerQuery[out];
    }
  }
  int totalPowerConsumed=0;
  if (totalPowerContained > 0) {
    for (int out=0; out < 6; ++out) {
      externalPower[out]=0;
      if (powerQuery[out] > 0 && internalPower[out] == 0) {
        int powerConsumed=(int)Math.floor((double)(powerQuery[out] * totalPowerContained) / totalPowerQuery);
        boolean tilePowered=false;
        if (tiles[out] instanceof TileGenericPipe) {
          TileGenericPipe nearbyTile=(TileGenericPipe)tiles[out];
          PipeTransportPower nearbyTransport=(PipeTransportPower)nearbyTile.pipe.transport;
          powerConsumed=nearbyTransport.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[out].getOpposite(),powerConsumed);
          tilePowered=true;
        }
 else         if (tiles[out] instanceof IEnergyHandler) {
          IEnergyHandler handler=(IEnergyHandler)tiles[out];
          if (handler.canConnectEnergy(ForgeDirection.VALID_DIRECTIONS[out].getOpposite())) {
            powerConsumed=handler.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[out].getOpposite(),powerConsumed,false);
            tilePowered=true;
          }
        }
 else {
          PowerReceiver prov=getReceiverOnSide(ForgeDirection.VALID_DIRECTIONS[out]);
          if (prov != null) {
            powerConsumed=(int)Math.ceil(prov.receiveEnergy(Type.PIPE,(double)powerConsumed / 10.0,ForgeDirection.VALID_DIRECTIONS[out].getOpposite()) * 10);
            tilePowered=true;
          }
        }
        if (!tilePowered) {
          externalPower[out]=powerConsumed;
        }
        displayPower[out]+=powerConsumed;
        totalPowerConsumed+=powerConsumed;
      }
    }
  }
  if (totalPowerConsumed > 0) {
    for (int in=0; in < 6; ++in) {
      int powerConsumed=(int)Math.floor(internalPower[in] / totalPowerContained * totalPowerConsumed);
      displayPower[in]+=powerConsumed;
    }
  }
  highestPower=0;
  for (int i=0; i < 6; i++) {
    displayPower[i]=(short)((prevDisplayPower[i] * (DISPLAY_SMOOTHING - 1.0F) + displayPower[i]) / DISPLAY_SMOOTHING);
    if (displayPower[i] > highestPower) {
      highestPower=displayPower[i];
    }
    if (displayPower[i] < 0.01) {
      displayPower[i]=0;
    }
  }
  overload+=highestPower > maxPower * 0.95 ? 1 : -1;
  if (overload < 0) {
    overload=0;
  }
  if (overload > OVERLOAD_TICKS) {
    overload=OVERLOAD_TICKS;
  }
  for (  ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
    TileEntity tile=tiles[dir.ordinal()];
    if (tile instanceof IEnergyHandler) {
      IEnergyHandler handler=(IEnergyHandler)tile;
      if (handler.canConnectEnergy(dir.getOpposite())) {
        int request=handler.receiveEnergy(dir.getOpposite(),this.maxPower,true);
        if (request > 0) {
          requestEnergy(dir,request);
        }
      }
    }
 else     if (!(tile instanceof TileGenericPipe && ((TileGenericPipe)tile).pipe.transport instanceof PipeTransportPower)) {
      PowerReceiver prov=getReceiverOnSide(dir);
      if (prov != null) {
        int request=(int)Math.floor(prov.powerRequest() * 10);
        if (request > 0) {
          requestEnergy(dir,request);
        }
      }
    }
  }
  int[] transferQuery=new int[6];
  for (int i=0; i < 6; ++i) {
    transferQuery[i]=0;
    for (int j=0; j < 6; ++j) {
      if (j != i) {
        transferQuery[i]+=powerQuery[j];
      }
    }
    transferQuery[i]=Math.min(transferQuery[i],maxPower);
  }
  for (int i=0; i < 6; ++i) {
    if (transferQuery[i] != 0) {
      if (tiles[i] != null) {
        TileEntity entity=tiles[i];
        if (entity instanceof TileGenericPipe) {
          TileGenericPipe nearbyTile=(TileGenericPipe)entity;
          if (nearbyTile.pipe == null) {
            continue;
          }
          PipeTransportPower nearbyTransport=(PipeTransportPower)nearbyTile.pipe.transport;
          nearbyTransport.requestEnergy(ForgeDirection.VALID_DIRECTIONS[i].getOpposite(),transferQuery[i]);
        }
      }
    }
  }
  if (tracker.markTimeIfDelay(container.getWorldObj())) {
    PacketPowerUpdate packet=new PacketPowerUpdate(container.xCoord,container.yCoord,container.zCoord);
    packet.displayPower=displayPower;
    packet.overload=isOverloaded();
    BuildCraftTransport.instance.sendToPlayers(packet,container.getWorldObj(),container.xCoord,container.yCoord,container.zCoord,DefaultProps.PIPE_CONTENTS_RENDER_DIST);
  }
}