@Override
	public void run() {
		map = new Map();
		try {
			Game.server.sendPacketToAllClients(new Packet8Attribute("mapeditor_progress_string", "generatemap"));
		} catch (Exception e) {}
		
		for (int i = 0; i < playableIslands; i++) {
			float y = (float) (Math.random() * 256);
			Point spot = pickRandomSpot();
			generateIsland(y, 32, 48);
			gen.finishedIsland.setPos(new Vector3f(spot.x * Island.SIZE, y, spot.y * Island.SIZE));
			
			map.addIsland(gen.finishedIsland);
			sendIsland(gen.finishedIsland);
		}
		
		for (int i = 0; i < size.getSize(); i++) {
			for (int j = 0; j < size.getSize(); j++) {
				if (takenSpots.contains(new Point(i, j))) continue;
				float y = (float) (Math.random() * 256);
				generateIsland(y, 12, 20);
				gen.finishedIsland.setPos(new Vector3f(i * Island.SIZE, y, j * Island.SIZE));
				
				map.addIsland(gen.finishedIsland);
				sendIsland(gen.finishedIsland);
			}
		}
		
		Game.server.setMap(map);
		try {
			Game.server.sendPacketToAllClients(new Packet8Attribute("mapeditor_progress_float", 1));
		} catch (Exception e) {}
	}