code: private void checkVerticalLimit(double extrp, double vy)
      {
          // Inside interval
          if (mover.getY() >= limitBottom
              && mover.getY() <= limitTop
              && limitBottom != Integer.MIN_VALUE
              && limitTop != Integer.MAX_VALUE)
          {
              offset.moveLocation(extrp, 0, vy);
  
              // Block offset on its limits
              if (offset.getY() < -intervalVertical)
              {
                  offset.teleportY(-intervalVertical);
              }
              else if (offset.getY() > intervalVertical)
              {
                  offset.teleportY(intervalVertical);
              }
          }
          // Outside interval
          if ((int) offset.getY() == -intervalVertical || (int) offset.getY() == intervalVertical)
          {
              mover.moveLocationY(extrp, vy);
          }
          applyVerticalLimit();
      }
docs: Check vertical limit on move.
  
  @param extrp The extrapolation value.
  @param vy The vertical movement.