public WorldFillTask(Server theServer, Player player, String worldName, int fillDistance, int chunksPerRun, int tickFrequency)
	{
		this.server = theServer;
		this.notifyPlayer = player;
		this.fillDistance = fillDistance;
		this.tickFrequency = tickFrequency;
		this.chunksPerRun = chunksPerRun;

		this.world = server.getWorld(worldName);
		if (this.world == null)
		{
			if (worldName.isEmpty())
				sendMessage("You must specify a world!");
			else
				sendMessage("World \"" + worldName + "\" not found!");
			this.stop();
			return;
		}

		this.border = (Config.Border(worldName) == null) ? null : Config.Border(worldName).copy();
		if (this.border == null)
		{
			sendMessage("No border found for world \"" + worldName + "\"!");
			this.stop();
			return;
		}

		// load up a new WorldFileData for the world in question, used to scan region files for which chunks are already fully generated and such
		worldData = WorldFileData.create(world, notifyPlayer);
		if (worldData == null)
		{
			this.stop();
			return;
		}

		this.border.setRadiusX(border.getRadiusX() + fillDistance);
		this.border.setRadiusZ(border.getRadiusZ() + fillDistance);
		this.x = CoordXZ.blockToChunk((int)border.getX());
		this.z = CoordXZ.blockToChunk((int)border.getZ());

		int chunkWidthX = (int) Math.ceil((double)((border.getRadiusX() + 16) * 2) / 16);
		int chunkWidthZ = (int) Math.ceil((double)((border.getRadiusZ() + 16) * 2) / 16);
		int biggerWidth = (chunkWidthX > chunkWidthZ) ? chunkWidthX : chunkWidthZ; //We need to calculate the reportTarget with the bigger with, since the spiral will only stop if it has a size of biggerWidth x biggerWidth
		this.reportTarget = (biggerWidth * biggerWidth) + biggerWidth + 1;

		//This would be another way to calculate reportTarget, it assumes that we don't need time to check if the chunk is outside and then skip it (it calculates the area of the rectangle/ellipse)
		//this.reportTarget = (this.border.getShape()) ? ((int) Math.ceil(chunkWidthX * chunkWidthZ / 4 * Math.PI + 2 * chunkWidthX)) : (chunkWidthX * chunkWidthZ);
		//                                                                       Area of the ellipse                 just to be safe      area of the rectangle
		
		
		// keep track of the chunks which are already loaded when the task starts, to not unload them
		Chunk[] originals = world.getLoadedChunks();
		for (Chunk original : originals)
		{
			originalChunks.add(new CoordXZ(original.getX(), original.getZ()));
		}

		this.readyToGo = true;
	}