mirror of
				https://github.com/FaceDeer/dfcaverns.git
				synced 2025-10-31 16:25:22 +01:00 
			
		
		
		
	add location logging for debugging purposes
This commit is contained in:
		| @@ -78,6 +78,11 @@ end | |||||||
| local c_air = minetest.get_content_id("air") | local c_air = minetest.get_content_id("air") | ||||||
| local c_web | local c_web | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
|  |  | ||||||
| local big_webs_path = minetest.get_modpath("big_webs") | local big_webs_path = minetest.get_modpath("big_webs") | ||||||
| if big_webs_path then | if big_webs_path then | ||||||
| 	c_web = minetest.get_content_id("big_webs:webbing") | 	c_web = minetest.get_content_id("big_webs:webbing") | ||||||
| @@ -145,13 +150,16 @@ minetest.register_on_generated(function(minp, maxp, seed) | |||||||
| 					webs = webs or calculate_web_array(minp, maxp) -- only calculate webs when we know we're in a chasm | 					webs = webs or calculate_web_array(minp, maxp) -- only calculate webs when we know we're in a chasm | ||||||
| 					if webs[y + z*z_displace] and math.random() < 0.85 then -- random holes in the web | 					if webs[y + z*z_displace] and math.random() < 0.85 then -- random holes in the web | ||||||
| 						data[i] = c_web | 						data[i] = c_web | ||||||
| 						minetest.get_node_timer({x=x,y=y,z=z}):start(1) -- this timer will check for unsupported webs | 						local web_pos = vector.new(x,y,z) | ||||||
|  | 						minetest.get_node_timer(web_pos):start(1) -- this timer will check for unsupported webs | ||||||
|  | 						if log_location then log_location("chasm_web", web_pos) end | ||||||
| 					else | 					else | ||||||
| 						data[i] = c_air | 						data[i] = c_air | ||||||
| 					end | 					end | ||||||
| 				else | 				else | ||||||
| 					data[i] = c_air | 					data[i] = c_air | ||||||
| 				end | 				end | ||||||
|  | 				if log_location then log_location("chasm", vector.new(x,y,z)) end | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
|   | |||||||
| @@ -9,6 +9,10 @@ local c_mese_crystal = df_caverns.node_id.mese_crystal | |||||||
| local c_mese_crystal_block = df_caverns.node_id.mese_crystal_block | local c_mese_crystal_block = df_caverns.node_id.mese_crystal_block | ||||||
| local c_obsidian = df_caverns.node_id.obsidian | local c_obsidian = df_caverns.node_id.obsidian | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ||||||
|  |  | ||||||
| local perlin_cave = { | local perlin_cave = { | ||||||
| @@ -84,6 +88,7 @@ minetest.register_on_generated(function(minp, maxp, seed) | |||||||
| 				data[vi] = c_air | 				data[vi] = c_air | ||||||
| 			else | 			else | ||||||
| 				data[vi] = c_lava | 				data[vi] = c_lava | ||||||
|  | 				if log_location then log_location("magma_sea", area:position(vi)) end | ||||||
| 			end | 			end | ||||||
| 		elseif y > floor_height - 5 and y < ceiling_height and y <= lava_height + 2 and not mapgen_helper.buildable_to(data[vi]) then | 		elseif y > floor_height - 5 and y < ceiling_height and y <= lava_height + 2 and not mapgen_helper.buildable_to(data[vi]) then | ||||||
| 			data[vi] = c_obsidian -- thick obsidian floor | 			data[vi] = c_obsidian -- thick obsidian floor | ||||||
| @@ -112,13 +117,16 @@ minetest.register_on_generated(function(minp, maxp, seed) | |||||||
| 					-- decorate ceiling | 					-- decorate ceiling | ||||||
| 					if math.random() < 0.25 then | 					if math.random() < 0.25 then | ||||||
| 						data[vi] = c_meseore | 						data[vi] = c_meseore | ||||||
|  | 						if log_location then log_location("magma_sea_meseore", area:position(vi)) end | ||||||
| 					elseif mese_intensity > 0.75 and math.random() < 0.1 then | 					elseif mese_intensity > 0.75 and math.random() < 0.1 then | ||||||
| 						data[vi] = c_meseore | 						data[vi] = c_meseore | ||||||
| 						local bi = vi-area.ystride | 						local bi = vi-area.ystride | ||||||
| 						data[bi] = c_mese_crystal | 						data[bi] = c_mese_crystal | ||||||
| 						data_param2[bi] = math.random(1,4) + 19 | 						data_param2[bi] = math.random(1,4) + 19 | ||||||
|  | 						if log_location then log_location("magma_sea_mesecrystal", area:position(vi)) end | ||||||
| 					elseif mese_intensity > 0.85 and math.random() < 0.025 then | 					elseif mese_intensity > 0.85 and math.random() < 0.025 then | ||||||
| 						subterrane.big_stalactite(vi-area.ystride, area, data, 6, 13, c_meseore, c_meseore, c_mese_crystal_block) | 						subterrane.big_stalactite(vi-area.ystride, area, data, 6, 13, c_meseore, c_meseore, c_mese_crystal_block) | ||||||
|  | 						if log_location then log_location("magma_sea_mesebig", area:position(vi)) end | ||||||
| 					end | 					end | ||||||
| 				end | 				end | ||||||
| 			end | 			end | ||||||
|   | |||||||
| @@ -28,6 +28,11 @@ if minetest.get_modpath("df_farming") then | |||||||
| 	} | 	} | ||||||
| end | end | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
|  |  | ||||||
| local subsea_level = df_caverns.config.level1_min - (df_caverns.config.level1_min - df_caverns.config.ymax) * 0.33 | local subsea_level = df_caverns.config.level1_min - (df_caverns.config.level1_min - df_caverns.config.ymax) * 0.33 | ||||||
| local flooding_threshold = math.min(df_caverns.config.tunnel_flooding_threshold, df_caverns.config.cavern_threshold) | local flooding_threshold = math.min(df_caverns.config.tunnel_flooding_threshold, df_caverns.config.cavern_threshold) | ||||||
|  |  | ||||||
| @@ -125,15 +130,20 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data) | |||||||
| 		if minp.y < subsea_level and area:get_y(vi) < subsea_level and flooded_caverns then | 		if minp.y < subsea_level and area:get_y(vi) < subsea_level and flooded_caverns then | ||||||
| 			-- underwater floor | 			-- underwater floor | ||||||
| 			df_caverns.flooded_cavern_floor(abs_cracks, vert_rand, vi, area, data) | 			df_caverns.flooded_cavern_floor(abs_cracks, vert_rand, vi, area, data) | ||||||
|  | 			if log_location then log_location("level1_flooded_"..biome_name, area:position(vi)) end | ||||||
| 		elseif biome_name == "towercap" then | 		elseif biome_name == "towercap" then | ||||||
| 			tower_cap_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 			tower_cap_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 			if log_location then log_location("level1_towercap", area:position(vi)) end | ||||||
| 		elseif biome_name == "fungiwood"  then | 		elseif biome_name == "fungiwood"  then | ||||||
| 			fungiwood_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 			fungiwood_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 			if log_location then log_location("level1_fungiwood", area:position(vi)) end | ||||||
| 		elseif biome_name == "barren" then | 		elseif biome_name == "barren" then | ||||||
| 			if flooded_caverns then | 			if flooded_caverns then | ||||||
| 				df_caverns.wet_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 				df_caverns.wet_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 				if log_location then log_location("level1_barren_wet", area:position(vi)) end | ||||||
| 			else | 			else | ||||||
| 				df_caverns.dry_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 				df_caverns.dry_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 				if log_location then log_location("level1_barren_dry", area:position(vi)) end | ||||||
| 			end | 			end | ||||||
| 		end		 | 		end		 | ||||||
| 	end | 	end | ||||||
| @@ -222,6 +232,12 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data) | |||||||
| 		local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. | 		local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. | ||||||
| 		local ystride = area.ystride | 		local ystride = area.ystride | ||||||
|  |  | ||||||
|  | 		if log_location then | ||||||
|  | 			local flood_name = "" | ||||||
|  | 			if flooded_caverns then flood_name = "_flooded" end | ||||||
|  | 			log_location("level1_warren_"..biome_name..flood_name, area:position(vi)) | ||||||
|  | 		end | ||||||
|  |  | ||||||
| 		if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then | 		if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then | ||||||
| 			if flooded_caverns or biome_name ~= "barren" then		 | 			if flooded_caverns or biome_name ~= "barren" then		 | ||||||
| 				-- we're in flooded areas or are not barren | 				-- we're in flooded areas or are not barren | ||||||
|   | |||||||
| @@ -16,6 +16,10 @@ local c_pearls = df_caverns.node_id.pearls | |||||||
|  |  | ||||||
| local chasms_path = minetest.get_modpath("chasms") | local chasms_path = minetest.get_modpath("chasms") | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
|  |  | ||||||
| local wall_vein_perlin_params = { | local wall_vein_perlin_params = { | ||||||
| 	offset = 0, | 	offset = 0, | ||||||
| @@ -168,6 +172,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) | |||||||
| 					if data[vi] == c_air and math.abs(vein_noise[vein_area:transform(area, vi)]) < 0.02 then | 					if data[vi] == c_air and math.abs(vein_noise[vein_area:transform(area, vi)]) < 0.02 then | ||||||
| 						data[vi] = c_veinstone | 						data[vi] = c_veinstone | ||||||
| 					end | 					end | ||||||
|  | 					if log_location then log_location("level2_veinstone", area:position(vi)) end | ||||||
| 				end | 				end | ||||||
| 			end | 			end | ||||||
| 			if data[vi] == c_air and y <= subsea_level then | 			if data[vi] == c_air and y <= subsea_level then | ||||||
| @@ -189,18 +194,24 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) | |||||||
| 		if minp.y < subsea_level and area:get_y(vi) < subsea_level and flooded_caverns then | 		if minp.y < subsea_level and area:get_y(vi) < subsea_level and flooded_caverns then | ||||||
| 			-- underwater floor | 			-- underwater floor | ||||||
| 			df_caverns.flooded_cavern_floor(abs_cracks, vert_rand, vi, area, data) | 			df_caverns.flooded_cavern_floor(abs_cracks, vert_rand, vi, area, data) | ||||||
|  | 			if log_location then log_location("level2_flooded_"..biome_name, area:position(vi)) end | ||||||
| 		elseif biome_name == "barren" then | 		elseif biome_name == "barren" then | ||||||
| 			if flooded_caverns then | 			if flooded_caverns then | ||||||
| 				df_caverns.wet_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 				df_caverns.wet_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 				if log_location then log_location("level2_barren_wet", area:position(vi)) end | ||||||
| 			else | 			else | ||||||
| 				df_caverns.dry_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 				df_caverns.dry_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 				if log_location then log_location("level2_barren_dry", area:position(vi)) end | ||||||
| 			end | 			end | ||||||
| 		elseif biome_name == "goblincap" then | 		elseif biome_name == "goblincap" then | ||||||
| 			goblin_cap_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 			goblin_cap_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 			if log_location then log_location("level2_goblincap", area:position(vi)) end | ||||||
| 		elseif biome_name == "sporetree" then | 		elseif biome_name == "sporetree" then | ||||||
| 			spore_tree_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2)			 | 			spore_tree_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2)			 | ||||||
|  | 			if log_location then log_location("level2_sporetree", area:position(vi)) end | ||||||
| 		elseif biome_name == "tunneltube" then | 		elseif biome_name == "tunneltube" then | ||||||
| 			tunnel_tube_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 			tunnel_tube_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 			if log_location then log_location("level2_tunneltube", area:position(vi)) end | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
| @@ -303,6 +314,12 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data) | |||||||
| 		local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) | 		local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) | ||||||
| 		local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. | 		local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. | ||||||
|  |  | ||||||
|  | 		if log_location then | ||||||
|  | 			local flood_name = "" | ||||||
|  | 			if flooded_caverns then flood_name = "_flooded" end | ||||||
|  | 			log_location("level2_warren_"..biome_name..flood_name, area:position(vi)) | ||||||
|  | 		end | ||||||
|  | 	 | ||||||
| 		if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then | 		if not (flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level) then | ||||||
| 			if flooded_caverns or biome_name ~= "barren" then		 | 			if flooded_caverns or biome_name ~= "barren" then		 | ||||||
| 				-- we're in flooded areas or are not barren | 				-- we're in flooded areas or are not barren | ||||||
|   | |||||||
| @@ -21,6 +21,11 @@ local c_webs_egg = df_caverns.node_id.big_webs_egg | |||||||
|  |  | ||||||
| local chasms_path = minetest.get_modpath("chasms") | local chasms_path = minetest.get_modpath("chasms") | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
|  |  | ||||||
| local subsea_level = math.floor(df_caverns.config.level3_min - (df_caverns.config.level3_min - df_caverns.config.level2_min) * 0.33) | local subsea_level = math.floor(df_caverns.config.level3_min - (df_caverns.config.level3_min - df_caverns.config.level2_min) * 0.33) | ||||||
| local flooding_threshold = math.min(df_caverns.config.tunnel_flooding_threshold, df_caverns.config.cavern_threshold) | local flooding_threshold = math.min(df_caverns.config.tunnel_flooding_threshold, df_caverns.config.cavern_threshold) | ||||||
|  |  | ||||||
| @@ -228,10 +233,12 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) | |||||||
| 						-- oil slick | 						-- oil slick | ||||||
| 						if y == subsea_level and data[vi] == c_water and math.abs(cave) + nvals_cracks[index2d]*0.025 < cavern_def.cave_threshold + 0.1 then | 						if y == subsea_level and data[vi] == c_water and math.abs(cave) + nvals_cracks[index2d]*0.025 < cavern_def.cave_threshold + 0.1 then | ||||||
| 							data[vi] = c_oil | 							data[vi] = c_oil | ||||||
|  | 							if log_location then log_location("level3_blackcap_oil", vector.new(x,y,z)) end | ||||||
| 						end | 						end | ||||||
| 					elseif biome_name == "bloodnether" and y <= subsea_level and y > subsea_level - ice_thickness and data[vi] == c_water then | 					elseif biome_name == "bloodnether" and y <= subsea_level and y > subsea_level - ice_thickness and data[vi] == c_water then | ||||||
| 						-- floating ice | 						-- floating ice | ||||||
| 						data[vi] = c_ice | 						data[vi] = c_ice | ||||||
|  | 						if log_location then log_location("level3_nethercap_floating_ice", vector.new(x,y,z)) end | ||||||
| 					end | 					end | ||||||
| 				end | 				end | ||||||
| 			end | 			end | ||||||
| @@ -250,7 +257,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) | |||||||
| 		local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. | 		local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. | ||||||
|  |  | ||||||
| 		if flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level then | 		if flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level then | ||||||
| 			-- underwater floor | 			-- underwater floor. Not using df_caverns.flooded_cavern_floor to make level 3 water darker | ||||||
| 			local ystride = area.ystride | 			local ystride = area.ystride | ||||||
| 			if abs_cracks > 0.25 and data[vi-ystride] ~= c_water then | 			if abs_cracks > 0.25 and data[vi-ystride] ~= c_water then | ||||||
| 				data[vi] = c_gravel | 				data[vi] = c_gravel | ||||||
| @@ -261,10 +268,12 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) | |||||||
| 					subterrane.big_stalagmite(vi+ystride, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone) | 					subterrane.big_stalagmite(vi+ystride, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone) | ||||||
| 				end | 				end | ||||||
| 			end | 			end | ||||||
|  | 			if log_location then log_location("level3_flooded_"..biome_name, area:position(vi)) end | ||||||
| 		elseif biome_name == "barren" then | 		elseif biome_name == "barren" then | ||||||
| 			if flooded_caverns then | 			if flooded_caverns then | ||||||
| 				-- wet zone floor | 				-- wet zone floor | ||||||
| 				df_caverns.dry_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 				df_caverns.dry_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 				if log_location then log_location("level3_barren_dry", area:position(vi)) end | ||||||
| 			else | 			else | ||||||
| 				-- dry zone floor, add crystals | 				-- dry zone floor, add crystals | ||||||
| 				if abs_cracks < 0.075 then | 				if abs_cracks < 0.075 then | ||||||
| @@ -272,14 +281,18 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) | |||||||
| 				elseif abs_cracks > 0.3 and math.random() < 0.005 then | 				elseif abs_cracks > 0.3 and math.random() < 0.005 then | ||||||
| 					df_mapitems.place_big_crystal_cluster(area, data, data_param2, vi+area.ystride,  math.random(0,2), false) | 					df_mapitems.place_big_crystal_cluster(area, data, data_param2, vi+area.ystride,  math.random(0,2), false) | ||||||
| 				end | 				end | ||||||
|  | 				if log_location then log_location("level3_barren_wet", area:position(vi)) end | ||||||
| 			end | 			end | ||||||
| 		elseif biome_name == "blackcap" then | 		elseif biome_name == "blackcap" then | ||||||
| 			black_cap_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 			black_cap_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 			if log_location then log_location("level3_blackcap", area:position(vi)) end | ||||||
| 		elseif biome_name == "bloodnether" then | 		elseif biome_name == "bloodnether" then | ||||||
| 			if flooded_caverns then | 			if flooded_caverns then | ||||||
| 				nether_cap_cavern_floor(cracks, abs_cracks, vert_rand, vi, area, data, data_param2)				 | 				nether_cap_cavern_floor(cracks, abs_cracks, vert_rand, vi, area, data, data_param2)				 | ||||||
|  | 				if log_location then log_location("level3_nethercap", area:position(vi)) end | ||||||
| 			else | 			else | ||||||
| 				blood_thorn_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2)		 | 				blood_thorn_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2)		 | ||||||
|  | 				if log_location then log_location("level3_bloodthorn", area:position(vi)) end | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
| @@ -410,6 +423,12 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data) | |||||||
| 		local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) | 		local biome_name = get_biome(heatmap[index2d], humiditymap[index2d]) | ||||||
| 		local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. | 		local flooded_caverns = nvals_cave[vi] < 0 -- this indicates if we're in the "flooded" set of caves or not. | ||||||
| 		 | 		 | ||||||
|  | 		if log_location then | ||||||
|  | 			local flood_name = "" | ||||||
|  | 			if flooded_caverns then flood_name = "_flooded" end | ||||||
|  | 			log_location("level3_warren_"..biome_name..flood_name, area:position(vi)) | ||||||
|  | 		end | ||||||
|  | 		 | ||||||
| 		if flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level then | 		if flooded_caverns and minp.y < subsea_level and area:get_y(vi) < subsea_level then | ||||||
| 			-- underwater ceiling, do nothing | 			-- underwater ceiling, do nothing | ||||||
| 		elseif biome_name == "bloodnether" and flooded_caverns then | 		elseif biome_name == "bloodnether" and flooded_caverns then | ||||||
|   | |||||||
| @@ -8,6 +8,11 @@ local c_gas_wisp = df_caverns.node_id.gas_wisp | |||||||
| local c_lava = df_caverns.node_id.lava | local c_lava = df_caverns.node_id.lava | ||||||
| local c_obsidian = df_caverns.node_id.obsidian | local c_obsidian = df_caverns.node_id.obsidian | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
|  |  | ||||||
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ||||||
|  |  | ||||||
| local perlin_cave = { | local perlin_cave = { | ||||||
| @@ -86,6 +91,7 @@ minetest.register_on_generated(function(minp, maxp, seed) | |||||||
| 				end | 				end | ||||||
| 			else | 			else | ||||||
| 				data[vi] = c_oil | 				data[vi] = c_oil | ||||||
|  | 				if log_location then log_location("oil_sea", area:position(vi)) end | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
| 		 | 		 | ||||||
|   | |||||||
| @@ -4,6 +4,11 @@ end | |||||||
|  |  | ||||||
| local c_air = df_caverns.node_id.air | local c_air = df_caverns.node_id.air | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
|  |  | ||||||
| local perlin_cave_primordial = { | local perlin_cave_primordial = { | ||||||
| 	offset = 0, | 	offset = 0, | ||||||
| 	scale = 1, | 	scale = 1, | ||||||
| @@ -160,6 +165,16 @@ local jungle_cavern_floor = function(abs_cracks, humidity, vi, area, data, data_ | |||||||
| 	local ystride = area.ystride | 	local ystride = area.ystride | ||||||
| 	local humidityfactor = humidity/100 | 	local humidityfactor = humidity/100 | ||||||
| 	 | 	 | ||||||
|  | 	if log_location then | ||||||
|  | 		local pos = area:position(vi) | ||||||
|  | 		log_location("primordial_jungle", pos) | ||||||
|  | 		if humidityfactor < 0.25 then | ||||||
|  | 			log_location("primordial_jungle_low_humidity", pos) | ||||||
|  | 		elseif humidityfactor > 0.75 then | ||||||
|  | 			log_location("primordial_jungle_high_humidity", pos) | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  |  | ||||||
| 	data[vi] = c_jungle_dirt | 	data[vi] = c_jungle_dirt | ||||||
|  |  | ||||||
| 	local rand = math.random() | 	local rand = math.random() | ||||||
| @@ -278,6 +293,7 @@ local decorate_primordial = function(minp, maxp, seed, vm, node_arrays, area, da | |||||||
| 			jungle_cavern_floor(abs_cracks, humidity, vi, area, data, data_param2) | 			jungle_cavern_floor(abs_cracks, humidity, vi, area, data, data_param2) | ||||||
| 		else | 		else | ||||||
| 			mushroom_cavern_floor(abs_cracks, humidity, vi, area, data, data_param2) | 			mushroom_cavern_floor(abs_cracks, humidity, vi, area, data, data_param2) | ||||||
|  | 			if log_location then log_location("primordial_mushrooms", area:position(vi)) end | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
| 	 | 	 | ||||||
| @@ -337,8 +353,10 @@ local decorate_primordial = function(minp, maxp, seed, vm, node_arrays, area, da | |||||||
| 		 | 		 | ||||||
| 		if jungle then | 		if jungle then | ||||||
| 			jungle_warren_floor(abs_cracks, vi, area, data, data_param2) | 			jungle_warren_floor(abs_cracks, vi, area, data, data_param2) | ||||||
|  | 			if log_location then log_location("primordial_jungle_warren", area:position(vi)) end | ||||||
| 		else | 		else | ||||||
| 			mushroom_warren_floor(abs_cracks, vi, area, data, data_param2) | 			mushroom_warren_floor(abs_cracks, vi, area, data, data_param2) | ||||||
|  | 			if log_location then log_location("primordial_mushroom_warren", area:position(vi)) end | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
|   | |||||||
| @@ -11,6 +11,11 @@ local c_obsidian = df_caverns.node_id.obsidian | |||||||
|  |  | ||||||
| local chasms_path = minetest.get_modpath("chasms") | local chasms_path = minetest.get_modpath("chasms") | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
|  |  | ||||||
| local c_coral_table = {} | local c_coral_table = {} | ||||||
| for node_name, node_def in pairs(minetest.registered_nodes) do | for node_name, node_def in pairs(minetest.registered_nodes) do | ||||||
| 	if minetest.get_item_group(node_name, "dfcaverns_cave_coral") > 0 then | 	if minetest.get_item_group(node_name, "dfcaverns_cave_coral") > 0 then | ||||||
| @@ -231,6 +236,7 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d | |||||||
| 					end | 					end | ||||||
| 				elseif y > floor_height and y < ceiling_height and data[vi] ~= c_wet_flowstone then | 				elseif y > floor_height and y < ceiling_height and data[vi] ~= c_wet_flowstone then | ||||||
| 					data[vi] = c_air | 					data[vi] = c_air | ||||||
|  | 					if log_location then log_location("sunless_sea_river", vector.new(x,y,z)) end | ||||||
| 				elseif y == ceiling_height and not mapgen_helper.buildable_to(data[vi]) then | 				elseif y == ceiling_height and not mapgen_helper.buildable_to(data[vi]) then | ||||||
| 					df_caverns.glow_worm_cavern_ceiling(math.abs(cracks), | 					df_caverns.glow_worm_cavern_ceiling(math.abs(cracks), | ||||||
| 						mapgen_helper.xz_consistent_randomi(area, vi), vi, area, data, data_param2) | 						mapgen_helper.xz_consistent_randomi(area, vi), vi, area, data, data_param2) | ||||||
| @@ -281,12 +287,16 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d | |||||||
| 			if y >= sea_level  then | 			if y >= sea_level  then | ||||||
| 				if heat > hot_zone_boundary then | 				if heat > hot_zone_boundary then | ||||||
| 					hot_zone_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 					hot_zone_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 					if log_location then log_location("sunless_sea_hot", area:position(vi)) end | ||||||
| 				elseif heat > middle_zone_boundary then | 				elseif heat > middle_zone_boundary then | ||||||
| 					fungispore_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 					fungispore_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 					if log_location then log_location("sunless_sea_fungispore", area:position(vi)) end | ||||||
| 				elseif heat > cool_zone_boundary then | 				elseif heat > cool_zone_boundary then | ||||||
| 					towergoblin_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 					towergoblin_cavern_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 					if log_location then log_location("sunless_sea_towergoblin", area:position(vi)) end | ||||||
| 				else | 				else | ||||||
| 					cool_zone_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | 					cool_zone_floor(abs_cracks, vert_rand, vi, area, data, data_param2) | ||||||
|  | 					if log_location then log_location("sunless_sea_cool", area:position(vi)) end | ||||||
| 				end | 				end | ||||||
| 			elseif y >= sea_level - 30 then | 			elseif y >= sea_level - 30 then | ||||||
| 				if math.random() < 0.005 then | 				if math.random() < 0.005 then | ||||||
| @@ -300,6 +310,7 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d | |||||||
| 					local iterations = math.random(1, 6) | 					local iterations = math.random(1, 6) | ||||||
| 					df_mapitems.spawn_coral_pile(area, data, vi, iterations) | 					df_mapitems.spawn_coral_pile(area, data, vi, iterations) | ||||||
| 					df_mapitems.spawn_castle_coral(area, data, vi+area.ystride, iterations) | 					df_mapitems.spawn_castle_coral(area, data, vi+area.ystride, iterations) | ||||||
|  | 					if log_location then log_location("sunless_sea_castle_coral", area:position(vi)) end | ||||||
| 				end | 				end | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
| @@ -383,6 +394,7 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d | |||||||
| 	for _, vi in ipairs(node_arrays.warren_floor_nodes) do | 	for _, vi in ipairs(node_arrays.warren_floor_nodes) do | ||||||
| 		if area:get_y(vi) >= sea_level and not mapgen_helper.buildable_to(data[vi]) then | 		if area:get_y(vi) >= sea_level and not mapgen_helper.buildable_to(data[vi]) then | ||||||
| 			df_caverns.tunnel_floor(minp, maxp, area, vi, nvals_cracks, data, data_param2, true) | 			df_caverns.tunnel_floor(minp, maxp, area, vi, nvals_cracks, data, data_param2, true) | ||||||
|  | 			if log_location then log_location("sunless_sea_warren", area:position(vi)) end | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
|   | |||||||
| @@ -11,6 +11,11 @@ local name_generator_path = minetest.get_modpath("name_generator") | |||||||
|  |  | ||||||
| local hunters_enabled = minetest.get_modpath("hunter_statue") and df_underworld_items.config.underworld_hunter_statues | local hunters_enabled = minetest.get_modpath("hunter_statue") and df_underworld_items.config.underworld_hunter_statues | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
|  |  | ||||||
| local name_pit = function() end | local name_pit = function() end | ||||||
| local name_ruin = function() end | local name_ruin = function() end | ||||||
|  |  | ||||||
| @@ -387,6 +392,7 @@ minetest.register_on_generated(function(minp, maxp, seed) | |||||||
| 					if distance < pit.radius -2.5 then | 					if distance < pit.radius -2.5 then | ||||||
| 						if y < median + floor_displace + wave - pit.depth or y < underside_height + plasma_depth_min then | 						if y < median + floor_displace + wave - pit.depth or y < underside_height + plasma_depth_min then | ||||||
| 							data[vi] = c_pit_plasma | 							data[vi] = c_pit_plasma | ||||||
|  | 							if log_location then log_location("underworld_pit", vector.new(x,y,z)) end | ||||||
| 						else | 						else | ||||||
| 							data[vi] = c_air | 							data[vi] = c_air | ||||||
| 						end | 						end | ||||||
| @@ -472,6 +478,7 @@ minetest.register_on_generated(function(minp, maxp, seed) | |||||||
| 									named_waypoints.add_waypoint("underworld_ruins", {x=building.pos.x, y=floor_height+1, z=building.pos.z}, {name=name_ruin()}) | 									named_waypoints.add_waypoint("underworld_ruins", {x=building.pos.x, y=floor_height+1, z=building.pos.z}, {name=name_ruin()}) | ||||||
| 								end | 								end | ||||||
| 							end | 							end | ||||||
|  | 							if log_location then log_location("underworld_building", building.pos) end | ||||||
| 						elseif building.building_type == "small slab" then | 						elseif building.building_type == "small slab" then | ||||||
| 							mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, small_slab_schematic, building.rotation) | 							mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, small_slab_schematic, building.rotation) | ||||||
| 						else | 						else | ||||||
| @@ -499,6 +506,7 @@ minetest.register_on_generated(function(minp, maxp, seed) | |||||||
| 			end | 			end | ||||||
| 			puzzle_seal = {x=minp.x+3, y=floor_height+1, z=minp.z+3} | 			puzzle_seal = {x=minp.x+3, y=floor_height+1, z=minp.z+3} | ||||||
| 			minetest.log("info", "Puzzle seal generated at " .. minetest.pos_to_string(puzzle_seal)) | 			minetest.log("info", "Puzzle seal generated at " .. minetest.pos_to_string(puzzle_seal)) | ||||||
|  | 			if log_location then log_location("underworld_puzzle_seal", puzzle_seal) end | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,6 +1,11 @@ | |||||||
| local modpath = minetest.get_modpath(minetest.get_current_modname()) | local modpath = minetest.get_modpath(minetest.get_current_modname()) | ||||||
| local S = minetest.get_translator(minetest.get_current_modname()) | local S = minetest.get_translator(minetest.get_current_modname()) | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if minetest.get_modpath("mapgen_helper") and mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
|  |  | ||||||
| --stem | --stem | ||||||
| minetest.register_node("df_trees:goblin_cap_stem", { | minetest.register_node("df_trees:goblin_cap_stem", { | ||||||
| 	description = S("Goblin Cap Stem"), | 	description = S("Goblin Cap Stem"), | ||||||
| @@ -296,18 +301,22 @@ df_trees.spawn_goblin_cap_vm = function(vi, area, data, data_param2) | |||||||
| 		local pos = area:position(vi) | 		local pos = area:position(vi) | ||||||
| 		if math.random() < 0.5 then | 		if math.random() < 0.5 then | ||||||
| 			mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, big_goblin_cap_schem) | 			mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, big_goblin_cap_schem) | ||||||
|  | 			if log_location then log_location("goblin_cap_big", pos) end | ||||||
| 		elseif math.random() < 0.9 then | 		elseif math.random() < 0.9 then | ||||||
| 			mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, bigger_goblin_cap_schem) | 			mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, bigger_goblin_cap_schem) | ||||||
|  | 			if log_location then log_location("goblin_cap_bigger", pos) end | ||||||
| 		else | 		else | ||||||
| 			-- easter egg - every once in a while (0.5%), a mapgen Goblin cap is a Smurf house | 			-- easter egg - every once in a while (0.5%), a mapgen Goblin cap is a Smurf house | ||||||
| 			minetest.after(5, init_hut, pos) | 			minetest.after(5, init_hut, pos) | ||||||
| 			if math.random() < 0.5 then | 			if math.random() < 0.5 then | ||||||
| 				mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, big_goblin_cap_hut_schem) | 				mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, big_goblin_cap_hut_schem) | ||||||
|  | 				if log_location then log_location("goblin_cap_big_hut", pos) end | ||||||
| 			else | 			else | ||||||
| 				if init_vessels then | 				if init_vessels then | ||||||
| 					minetest.after(5, init_vessels, pos) | 					minetest.after(5, init_vessels, pos) | ||||||
| 				end | 				end | ||||||
| 				mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, bigger_goblin_cap_hut_schem) | 				mapgen_helper.place_schematic_on_data(data, data_param2, area, pos, bigger_goblin_cap_hut_schem) | ||||||
|  | 				if log_location then log_location("goblin_cap_bigger_hut", pos) end | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
| 		return | 		return | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| name = df_trees | name = df_trees | ||||||
| description = Adds various types of underground fungal "trees". Light kills their saplings, they only grow in the dark. | description = Adds various types of underground fungal "trees". Light kills their saplings, they only grow in the dark. | ||||||
| depends = default | depends = default | ||||||
| optional_depends = doc, moreblocks, stairs, vessels, basic_materials, farming, doors, beds, df_farming | optional_depends = doc, moreblocks, stairs, vessels, basic_materials, farming, doors, beds, df_farming, mapgen_helper | ||||||
 Submodule mapgen_helper updated: 5fe751ea81...4e226f1237
									
								
							| @@ -28,6 +28,11 @@ if minetest.get_modpath("default") then | |||||||
| 	end | 	end | ||||||
| end | end | ||||||
|  |  | ||||||
|  | local log_location | ||||||
|  | if minetest.get_modpath("mapgen_helper") and mapgen_helper.log_location_enabled then | ||||||
|  | 	log_location = mapgen_helper.log_first_location | ||||||
|  | end | ||||||
|  |  | ||||||
| local ignore | local ignore | ||||||
| if minetest.get_modpath("chasms") then | if minetest.get_modpath("chasms") then | ||||||
| 	-- the chasms mod already sets up a method to allow chasms to avoid overwriting stalactites and whatnot, | 	-- the chasms mod already sets up a method to allow chasms to avoid overwriting stalactites and whatnot, | ||||||
| @@ -137,6 +142,7 @@ minetest.register_on_generated(function(minp, maxp, seed) | |||||||
| 						data[vi] = c_gravel | 						data[vi] = c_gravel | ||||||
| 					else | 					else | ||||||
| 						data[vi] = c_air | 						data[vi] = c_air | ||||||
|  | 						if log_location then log_location("pit_cave", vector.new(x,y,z)) end | ||||||
| 					end | 					end | ||||||
| 				end | 				end | ||||||
| 			end | 			end | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user