Program: 34546
Project: 34546
Buggy source:
@Override public void onUpdate(){
}

Fixed version (ground truth):
@Override public void onUpdate(){
  if (--updatePedestalTimer <= 0) {
    updatePedestalTimer=20;
    int maxPedestals=8;
    int range=maxPedestals == 12 ? 4 : 3;
    long currentHash=0L;
    if (lastMaxPedestals != maxPedestals) {
      lastMaxPedestals=(byte)maxPedestals;
      pedestalAreaHash=0L;
    }
    World world=altar.getWorldObj();
    for (int xx=-range, id; xx <= range; xx++) {
      for (int zz=-range; zz <= range; zz++) {
        id=Block.getIdFromBlock(Pos.at(altar.xCoord + xx,altar.yCoord,altar.zCoord + zz).getBlock(world));
        currentHash+=((4 + xx) * 7 + (4 + zz) + id) * 262144L + (xx * id) + (zz * id);
      }
    }
    if (pedestalAreaHash != currentHash) {
      pedestalAreaHash=currentHash;
      pedestals.clear();
      IdentityHashMap<Block,Byte> blockCounts=new IdentityHashMap<>();
      Block[][] blocks=new Block[range * 2 + 1][range * 2 + 1];
      Pos tilePos=Pos.at(altar);
      Pos.forEachBlock(tilePos.offset(-range,0,-range),tilePos.offset(range,0,range),pos -> {
        if (Math.abs(pos.x - tilePos.getX()) <= 1 && Math.abs(pos.z - tilePos.getZ()) <= 1)         return;
        if (!(pos.getUp().isAir(world) && hasCollisionBox(altar,pos.getX(),pos.getY(),pos.getZ())))         return;
        for (        Facing4 facing : Facing4.list) {
          Pos offset=pos.offset(facing);
          if (!(offset.isAir(world) || !hasCollisionBox(altar,offset.getX(),offset.getY(),offset.getZ())))           return;
        }
        Block block=pos.getBlock(world);
        if (block.getMaterial() == Material.air)         return;
        blocks[range + pos.getX() - tilePos.getX()][range + pos.getZ() - tilePos.getZ()]=block;
        if (blockCounts.containsKey(block))         blockCounts.put(block,(byte)(blockCounts.get(block) + 1));
 else         blockCounts.put(block,(byte)1);
      }
);
      SortedSet<Entry<Block,Byte>> sorted=CollectionUtil.sortMapByValueDesc(blockCounts);
      for (      Entry<Block,Byte> entry : sorted) {
        if (entry.getValue() > maxPedestals)         continue;
        for (int xx=-range; xx <= range; xx++) {
          for (int zz=-range; zz <= range; zz++) {
            if (blocks[range + xx][range + zz] != entry.getKey())             continue;
            pedestals.add(Pos.at(altar.xCoord + xx,altar.yCoord,altar.zCoord + zz));
          }
        }
        break;
      }
    }
    for (    Pos pos : pedestals) {
      if (world.rand.nextInt(5) <= 1) {
        PacketPipeline.sendToAllAround(altar,64D,new C11ParticleAltarOrb(altar,pos.getX() + 0.5D,pos.getY() + 0.5D,pos.getZ() + 0.5D));
      }
    }
  }
  if (itemBoundingBox == null) {
    itemBoundingBox=AxisAlignedBB.getBoundingBox(altar.xCoord + 0.5D - 4.5D,altar.yCoord + 0.9D,altar.zCoord + 0.5D - 4.5D,altar.xCoord + 0.5 + 4.5D,altar.yCoord + 1.6D,altar.zCoord + 0.5D + 4.5D);
  }
  World world=altar.getWorldObj();
  List<EntityItem> thrownItems=EntitySelector.type(world,EntityItem.class,itemBoundingBox);
  double targX, targY, targZ;
  for (  EntityItem item : thrownItems) {
    for (    Pos pos : pedestals) {
      targX=pos.getX() + 0.5D;
      targY=pos.getY() + 1.15D;
      targZ=pos.getZ() + 0.5D;
      if (Math.abs(item.posX - targX) > 0.001D || Math.abs(item.posY - targY) > 0.001D || Math.abs(item.posZ - targZ) > 0.001D) {
        if (EntitySelector.type(world,EntityItemAltar.class,AxisAlignedBB.getBoundingBox(targX,targY,targZ,targX,targY,targZ)).isEmpty() && Math.sqrt(MathUtil.square(targX - item.posX) + MathUtil.square(targY - item.posY) + MathUtil.square(targZ - item.posZ)) < 0.275D) {
          world.spawnEntityInWorld(new EntityItemAltar(world,targX,targY,targZ,item,EssenceType.DRAGON.id));
        }
      }
 else       if ((updatePedestalTimer & 3) == 1 && item instanceof EntityItemAltar) {
        EntityItemAltar altarItem=(EntityItemAltar)item;
        altarItem.pedestalUpdate=0;
        if (altar.getEssenceLevel() > 0) {
          updatePedestalItem(altarItem);
          if (world.rand.nextInt(5) == 0) {
            PacketPipeline.sendToAllAround(altar.getWorldObj().provider.dimensionId,targX,pos.getY() + 0.5D,targZ,64D,new C11ParticleAltarOrb(targX,pos.getY() + 0.5D,targZ,item.posX,item.posY + 0.3D,item.posZ,altar.getEssenceType().id,(byte)1));
          }
        }
      }
    }
  }
}