public synchronized void regenerate() {
		Iterator<Map.Entry<ChunkSQL, ArrayList<LocationSQL>>> it = this.possibleLocations.entrySet().iterator();
		HashMap<String, Integer> properties;

		while(it.hasNext()) { //TODO: Implement HIGHEST_BLOCK
			Map.Entry<ChunkSQL, ArrayList<LocationSQL>> set = it.next();
			//ChunkSQL csql = set.getKey();
			Iterator<LocationSQL> it2 = set.getValue().iterator();
/*			int highestBlock = 0;
			int chunkBlockX, chunkBlockZ;

			chunkBlockX = csql.getX() << 4;
			chunkBlockZ = csql.getZ() << 4;

			//Get the highest block in the chunk
			for(int x = chunkBlockX; x < chunkBlockX+16; x++) {
				for(int z = chunkBlockZ; z < chunkBlockZ+16; z++) {
					int temp = Bukkit.getWorld(csql.getWorldName()).getHighestBlockYAt(x, z);
					if(temp > highestBlock) highestBlock = temp;
				}
			}*/

			//Iterate through the locations and place them in the optimal places
			while(it2.hasNext()) {
				LocationSQL location = it2.next();
				int y = location.getY();

				//Thank you Muddr for this, would of never thought about it
				for (Material ore : this.materialTypes) {
					properties = this.materialProperties.get(ore);
					int maxy = properties.get("maxy");
					int miny = properties.get("miny");
					int chance = properties.get("chance");

					if(y < maxy && y > miny && chance > 0) {
						ArrayList<LocationSQL> temploc = this.optimalMaterialLocations.get(ore);
						temploc.add(location);
						this.optimalMaterialLocations.put(ore, temploc);
					}

				}
			}
		}
	}