public int[] willBreakGround(int startX, int startZ, int endX, int endZ) {
        int[] groundLoc = new int[4];
        groundLoc[0] = 0;
        groundLoc[1] = 0;
        groundLoc[2] = 0;
        groundLoc[3] = 0;
        int dx = endX - startX;
        int dz = endZ - startZ;
        int count = (int) Math.sqrt(dx * dx + dz * dz);
        int i;
        double angle = 0.0;
        for (i = 0; i < count; i++) {
            if (gound[startX + (dx * i / count)] - (40 + CAVE_RADIUS) <= startZ + (dz * i / count)) {
                groundLoc[3] = 1;
            }
            if (gound[startX + (dx * i / count)] + CAVE_RADIUS * 2 / 3 <= startZ + (dz * i / count)) {
                groundLoc[2] = 1;
                break;
            }
        }
        if (groundLoc[2] == 1) {
            if (i < 2) {
                i = 2;
            }
            angle = Math.atan((gound[startX + (dx * i / count)] + CAVE_RADIUS * 2 - startZ) / (dx * i / count)) * 180 / Math.PI;
            if (angle < 46.0) {
                endZ = gound[startX + (dx * i / count)] + CAVE_RADIUS * 2;
                endX = dx * i / count + startX;
                groundLoc[2] = 0;
            } else {
                endZ -= dz / 3 + startZ;
            }
            dx = endX - startX;
            dz = endZ - startZ;
        }
        for (i = 0; i < count; i++) {
            if (gound[startX + (dx * i / count)] + CAVE_RADIUS <= startZ + (dz * i / count)) {
                groundLoc[0] = startX + (dx * i / count);
                groundLoc[1] = startZ + (dz * i / count);
                break;
            }
        }
        return groundLoc;
    }