private void updateAndQueueUpdate(StructureSpaceshipYard spaceshipYard, boolean update) {
    synchronized (spaceshipYard.getLock()) {
      spaceshipYard = DataAccess.getEditable(spaceshipYard);
      spaceshipYard.update();
      spaceshipYard.save();
    }

    if (update) {
      Structure structure = spaceshipYard.getStructure();
      Player owner = structure.getOwner();
      if (owner.getIdCurrentArea() == structure.getIdArea()) UpdateTools.queueAreaUpdate(owner);
    }

    queueUpdate(spaceshipYard);
  }
 private void queueUpdate(StructureSpaceshipYard spaceshipYard) {
   if (spaceshipYard.isBuilding()) {
     int end = spaceshipYard.getBuildEnd();
     if (end != Integer.MAX_VALUE) addJob(spaceshipYard.getIdStructure(), Utilities.now() + end);
   }
 }