public void generate(ICubicWorld world, ICubePrimer cube, CubePos cubePos) {
		//TODO: maybe skip some of this stuff if the cube is empty? (would need to use hints)
		int radius = this.range;
		this.world = world;
		this.rand.setSeed(world.getSeed());
		//used to randomize contribution of each coordinate to the cube seed
		//without these swapping x/y/z coordinates would result in the same seed
		//so structures would generate symmetrically
		long randX = this.rand.nextLong();
		long randY = this.rand.nextLong();
		long randZ = this.rand.nextLong();
		int cubeX = cubePos.getX();
		int cubeY = cubePos.getY();
		int cubeZ = cubePos.getZ();
		//x/y/zOrigin is location of the structure "center", and cubeX/Y/Z is the currently generated cube
		for (int xOrigin = cubeX - radius; xOrigin <= cubeX + radius; ++xOrigin) {
			for (int yOrigin = cubeY - radius; yOrigin <= cubeY + radius; ++yOrigin) {
				for (int zOrigin = cubeZ - radius; zOrigin <= cubeZ + radius; ++zOrigin) {
					long randX_mul = xOrigin*randX;
					long randY_mul = yOrigin*randY;
					long randZ_mul = zOrigin*randZ;
					this.rand.setSeed(randX_mul ^ randY_mul ^ randZ_mul ^ world.getSeed());
					this.generate(world, cube, xOrigin, yOrigin, zOrigin, cubePos);
				}
			}
		}
	}
public void generate(ICubicWorld world, ICubePrimer cube, CubePos cubePos) {
	
		int radius = this.range;
		this.world = world;
		this.rand.setSeed(world.getSeed());
	
	
	
		long randX = this.rand.nextLong();
		long randY = this.rand.nextLong();
		long randZ = this.rand.nextLong();
		int cubeX = cubePos.getX();
		int cubeY = cubePos.getY();
		int cubeZ = cubePos.getZ();
	
		for (int xOrigin = cubeX - radius; xOrigin <= cubeX + radius; ++xOrigin) {
			for (int yOrigin = cubeY - radius; yOrigin <= cubeY + radius; ++yOrigin) {
				for (int zOrigin = cubeZ - radius; zOrigin <= cubeZ + radius; ++zOrigin) {
					long randX_mul = xOrigin*randX;
					long randY_mul = yOrigin*randY;
					long randZ_mul = zOrigin*randZ;
					this.rand.setSeed(randX_mul ^ randY_mul ^ randZ_mul ^ world.getSeed());
					this.generate(world, cube, xOrigin, yOrigin, zOrigin, cubePos);
				}
			}
		}
	}
public void generate(icubicworld world, icubeprimer cube, cubepos cubepos) { int radius = this.range; this.world = world; this.rand.setseed(world.getseed()); long randx = this.rand.nextlong(); long randy = this.rand.nextlong(); long randz = this.rand.nextlong(); int cubex = cubepos.getx(); int cubey = cubepos.gety(); int cubez = cubepos.getz(); for (int xorigin = cubex - radius; xorigin <= cubex + radius; ++xorigin) { for (int yorigin = cubey - radius; yorigin <= cubey + radius; ++yorigin) { for (int zorigin = cubez - radius; zorigin <= cubez + radius; ++zorigin) { long randx_mul = xorigin*randx; long randy_mul = yorigin*randy; long randz_mul = zorigin*randz; this.rand.setseed(randx_mul ^ randy_mul ^ randz_mul ^ world.getseed()); this.generate(world, cube, xorigin, yorigin, zorigin, cubepos); } } } }