Program: 156773
Project: 156773
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();
  for (  ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
    if (tiles[side.ordinal()] != null && tiles[side.ordinal()].isInvalid()) {
      updateTile(side);
    }
  }
  System.arraycopy(displayPower,0,prevDisplayPower,0,6);
  Arrays.fill(displayPower,(short)0);
  for (int i=0; i < 6; ++i) {
    if (internalPower[i] > 0) {
      float totalPowerQuery=0;
      for (int j=0; j < 6; ++j) {
        if (j != i && powerQuery[j] > 0) {
          Object ep=getEnergyProvider(j);
          if (ep instanceof TileGenericPipe || ep instanceof IEnergyReceiver || ep instanceof IEnergyHandler) {
            totalPowerQuery+=powerQuery[j];
          }
        }
      }
      for (int j=0; j < 6; ++j) {
        if (j != i && powerQuery[j] > 0) {
          Object ep=getEnergyProvider(j);
          int watts=(int)Math.floor((internalPower[i] * powerQuery[j]) / totalPowerQuery);
          if (ep instanceof IPipeTile) {
            Pipe<?> nearbyPipe=(Pipe<?>)((IPipeTile)ep).getPipe();
            PipeTransportPower nearbyTransport=(PipeTransportPower)nearbyPipe.transport;
            watts=nearbyTransport.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite(),watts);
            internalPower[i]-=watts;
          }
 else           if (ep instanceof IEnergyHandler) {
            IEnergyHandler handler=(IEnergyHandler)ep;
            if (handler.canConnectEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite())) {
              watts=handler.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite(),watts,false);
              internalPower[i]-=watts;
            }
          }
 else           if (ep instanceof IEnergyReceiver) {
            IEnergyReceiver handler=(IEnergyReceiver)ep;
            if (handler.canConnectEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite())) {
              watts=handler.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite(),watts,false);
              internalPower[i]-=watts;
            }
          }
          displayPower[j]+=watts;
          displayPower[i]+=watts;
        }
      }
    }
  }
  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];
    }
  }
  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) {
    if (!outputOpen(dir)) {
      continue;
    }
    Object tile=getEnergyProvider(dir.ordinal());
    if (tile instanceof IPipeTile && ((Pipe<?>)((IPipeTile)tile).getPipe()).transport instanceof PipeTransportPower) {
      continue;
    }
    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 IEnergyReceiver) {
      IEnergyReceiver handler=(IEnergyReceiver)tile;
      if (handler.canConnectEnergy(dir.getOpposite())) {
        int request=handler.receiveEnergy(dir.getOpposite(),this.maxPower,true);
        if (request > 0) {
          requestEnergy(dir,request);
        }
      }
    }
  }
  int[] transferQuery=new int[6];
  for (int i=0; i < 6; ++i) {
    transferQuery[i]=0;
    if (!inputOpen(ForgeDirection.getOrientation(i))) {
      continue;
    }
    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) {
    return;
  }
  step();
  init();
  for (  ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
    if (tiles[side.ordinal()] != null && tiles[side.ordinal()].isInvalid()) {
      updateTile(side);
    }
  }
  System.arraycopy(displayPower,0,prevDisplayPower,0,6);
  Arrays.fill(displayPower,(short)0);
  for (int i=0; i < 6; ++i) {
    if (internalPower[i] > 0) {
      float totalPowerQuery=0;
      for (int j=0; j < 6; ++j) {
        if (j != i && powerQuery[j] > 0) {
          Object ep=getEnergyProvider(j);
          if (ep instanceof TileGenericPipe || ep instanceof IEnergyReceiver || ep instanceof IEnergyHandler) {
            totalPowerQuery+=powerQuery[j];
          }
        }
      }
      for (int j=0; j < 6; ++j) {
        if (j != i && powerQuery[j] > 0) {
          Object ep=getEnergyProvider(j);
          int watts=(int)Math.floor(internalPower[i] * powerQuery[j] / totalPowerQuery);
          if (ep instanceof IPipeTile) {
            Pipe<?> nearbyPipe=(Pipe<?>)((IPipeTile)ep).getPipe();
            PipeTransportPower nearbyTransport=(PipeTransportPower)nearbyPipe.transport;
            watts=nearbyTransport.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite(),watts);
            internalPower[i]-=watts;
          }
 else           if (ep instanceof IEnergyHandler) {
            IEnergyHandler handler=(IEnergyHandler)ep;
            if (handler.canConnectEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite())) {
              watts=handler.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite(),watts,false);
              internalPower[i]-=watts;
            }
          }
 else           if (ep instanceof IEnergyReceiver) {
            IEnergyReceiver handler=(IEnergyReceiver)ep;
            if (handler.canConnectEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite())) {
              watts=handler.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite(),watts,false);
              internalPower[i]-=watts;
            }
          }
          displayPower[j]+=watts;
          displayPower[i]+=watts;
        }
      }
    }
  }
  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];
    }
  }
  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) {
    if (!outputOpen(dir)) {
      continue;
    }
    Object tile=getEnergyProvider(dir.ordinal());
    if (tile instanceof IPipeTile && ((Pipe<?>)((IPipeTile)tile).getPipe()).transport instanceof PipeTransportPower) {
      continue;
    }
    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 IEnergyReceiver) {
      IEnergyReceiver handler=(IEnergyReceiver)tile;
      if (handler.canConnectEnergy(dir.getOpposite())) {
        int request=handler.receiveEnergy(dir.getOpposite(),this.maxPower,true);
        if (request > 0) {
          requestEnergy(dir,request);
        }
      }
    }
  }
  int[] transferQuery=new int[6];
  for (int i=0; i < 6; ++i) {
    transferQuery[i]=0;
    if (!inputOpen(ForgeDirection.getOrientation(i))) {
      continue;
    }
    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);
  }
}