private String developRiver(Point start, boolean d, int rivnum) {
		try {
			Random rnd = new Random();
			int broadnum = 0;
			int broadam = 0;
			Point end = findClosestEnding(start, rivnum);
			AStar astar = new AStar(null, MyzoGEN.DIMENSION_X * chunksX, MyzoGEN.DIMENSION_Y * chunksY, new ASPoint(start.x, start.y, true), new ASPoint(end.x, end.y, true), d, rivnum);
			ArrayList<ASPoint> path = astar.calculate();
			if (path != null) {
				for (ASPoint asp : path) {
					Tile t = MyzoGEN.getOutput().getTile(new Point(asp.x, asp.y));
					if (t != null) {
						t.tile = Tiles.WATER;
						t.river = true;
						t.riverID = rivnum;
						
						//Small chance to make the river broaden.
						if (broadnum <= 0) {
							if (rnd.nextInt(100) < 50) {
								if (rnd.nextInt(100) < 30) {
									broadam = 2;
								} else {
									broadam = 1;
								}
								broadnum = 6;
							}
						}
						
						if (broadnum > 0) {
							broadnum--;
							broadenRiver(t, broadam, rivnum);
							if (broadnum == 0) broadam = 0;
						}
					}
				}
			}
			path = null;
		} catch (Exception e) {e.printStackTrace();}
		
		if (details) System.out.println("Finished river.");
		
		return "No errors.";
	}