Program: 156372
Project: 156372
Buggy source:
private void onItemReachCenter(TravellingItem item){
  ItemStack oldStack=item.stack;
  PipeEventItem.ReachCenter reachCenter=new PipeEventItem.ReachCenter(pipe.getHolder(),this,oldStack.copy(),item.from,item.colour);
  if (pipe.getHolder().fireEvent(reachCenter)) {
    ItemStack newStack=reachCenter.stack;
    if (newStack.isEmpty()) {
      return;
    }
 else     if (item.colour == reachCenter.colour && ItemStack.areItemStacksEqual(oldStack,newStack)) {
      item.state=EnumTravelState.SERVER_TO_EXIT;
      item.colour=reachCenter.colour;
      items.add(item.timeToExit,item);
    }
 else {
      PipeEventItem.SideCheck sideCheck=new PipeEventItem.SideCheck(pipe.getHolder(),this,reachCenter.colour,item.from,newStack);
      sideCheck.disallow(item.from);
      if (item.tried != null) {
        sideCheck.disallowAll(item.tried);
      }
      for (      EnumFacing face : EnumFacing.VALUES) {
        if (!pipe.isConnected(face)) {
          sideCheck.disallow(face);
        }
      }
      pipe.getHolder().fireEvent(sideCheck);
      ItemEntry entry=new ItemEntry(reachCenter.colour,newStack,item.from);
      PipeEventItem.FindDest findDest=new PipeEventItem.FindDest(pipe.getHolder(),this,sideCheck.getOrder(),ImmutableList.of(entry));
      pipe.getHolder().fireEvent(findDest);
      if (entry.to == null) {
        entry.to=findDest.generateRandomOrder();
      }
      List<EnumFacing> to=entry.to;
      item.to=(to.size() <= 0) ? null : to.get(0);
      if (to.size() > 1) {
        item.toTryOrder=to.subList(1,to.size());
      }
 else {
        item.toTryOrder=null;
      }
      item.colour=entry.colour;
      item.stack=entry.stack;
      item.state=EnumTravelState.SERVER_TO_EXIT;
      items.add(item.timeToExit,item);
    }
  }
 else {
    item.state=EnumTravelState.SERVER_TO_EXIT;
    items.add(item.timeToExit,item);
  }
}

Fixed version (ground truth):
private void onItemReachCenter(TravellingItem item){
  IPipeHolder holder=pipe.getHolder();
  PipeEventItem.ReachCenter reachCenter=new PipeEventItem.ReachCenter(holder,this,item.colour,item.stack,item.side);
  holder.fireEvent(reachCenter);
  if (reachCenter.getStack().isEmpty()) {
    return;
  }
  PipeEventItem.SideCheck sideCheck=new PipeEventItem.SideCheck(holder,this,reachCenter.colour,reachCenter.from,reachCenter.getStack());
  sideCheck.disallow(reachCenter.from);
  for (  EnumFacing face : EnumFacing.VALUES) {
    if (item.tried.contains(face) || !pipe.isConnected(face)) {
      sideCheck.disallow(face);
    }
  }
  holder.fireEvent(sideCheck);
  List<EnumSet<EnumFacing>> order=sideCheck.getOrder();
  if (order.isEmpty()) {
    PipeEventItem.TryBounce tryBounce=new PipeEventItem.TryBounce(holder,this,reachCenter.colour,reachCenter.from,reachCenter.getStack());
    holder.fireEvent(tryBounce);
    if (tryBounce.canBounce) {
      order=ImmutableList.of(EnumSet.of(reachCenter.from));
    }
 else {
      dropItem(item.stack,null,item.side.getOpposite());
      return;
    }
  }
  PipeEventItem.ItemEntry entry=new PipeEventItem.ItemEntry(reachCenter.colour,reachCenter.getStack(),reachCenter.from);
  PipeEventItem.Split split=new PipeEventItem.Split(holder,this,order,entry);
  holder.fireEvent(split);
  ImmutableList<PipeEventItem.ItemEntry> entries=ImmutableList.copyOf(split.items);
  PipeEventItem.FindDest findDest=new PipeEventItem.FindDest(holder,this,order,entries);
  holder.fireEvent(findDest);
  World world=holder.getPipeWorld();
  long now=world.getTotalWorldTime();
  for (  PipeEventItem.ItemEntry itemEntry : findDest.items) {
    if (itemEntry.stack.isEmpty()) {
      continue;
    }
    PipeEventItem.ModifySpeed modifySpeed=new PipeEventItem.ModifySpeed(holder,this,itemEntry,item.speed);
    modifySpeed.modifyTo(0.04,0.01);
    holder.fireEvent(modifySpeed);
    double target=modifySpeed.targetSpeed;
    double maxDelta=modifySpeed.maxSpeedChange;
    double nSpeed=item.speed;
    if (nSpeed < target) {
      nSpeed+=maxDelta;
      if (nSpeed > target) {
        nSpeed=target;
      }
    }
 else     if (nSpeed > target) {
      nSpeed-=maxDelta;
      if (nSpeed < target) {
        nSpeed=target;
      }
    }
    if (itemEntry.to == null || itemEntry.to.size() == 0) {
      itemEntry.to=findDest.generateRandomOrder();
    }
    if (itemEntry.to.size() == 0) {
      dropItem(itemEntry.stack,null,item.side.getOpposite());
    }
 else {
      item.toCenter=false;
      item.stack=itemEntry.stack;
      item.colour=itemEntry.colour;
      item.side=itemEntry.to.get(0);
      item.speed=nSpeed;
      item.genTimings(now,getPipeLength(item.side));
      items.add(item.timeToDest,item);
      sendItemDataToClient(item);
    }
  }
}