Add noise/chunk border indicator switch into settingtypes

This commit is contained in:
kay27 2022-02-20 06:54:31 +04:00
parent b518bfd5c2
commit 63193638ed
3 changed files with 27 additions and 16 deletions

View File

@ -1,5 +1,4 @@
local step = 1 local step = 1
local chunk_borders = false
local levels = { local levels = {
[-9] = "black", [-9] = "black",
@ -31,6 +30,7 @@ local mcl_structures_get_perlin_noise_level = mcl_structures.get_perlin_noise_le
local noise_offset_x_and_z = math_floor(mcl_mapgen.CS_NODES/2) local noise_offset_x_and_z = math_floor(mcl_mapgen.CS_NODES/2)
mcl_mapgen.register_mapgen(function(minp, maxp, seed, vm_context) mcl_mapgen.register_mapgen(function(minp, maxp, seed, vm_context)
if minetest.settings:get_bool("mcl_debug_struct_noise", false) then
local y0 = minp.y local y0 = minp.y
for x0 = minp.x, maxp.x, step do for x0 = minp.x, maxp.x, step do
for z0 = minp.z, maxp.z, step do for z0 = minp.z, maxp.z, step do
@ -45,7 +45,9 @@ mcl_mapgen.register_mapgen(function(minp, maxp, seed, vm_context)
minetest.set_node({x=x0, y=y0, z=z0}, {name = "mcl_core:glass_"..levels[amount]}) minetest.set_node({x=x0, y=y0, z=z0}, {name = "mcl_core:glass_"..levels[amount]})
end end
end end
if chunk_borders then end
if minetest.settings:get_bool("mcl_debug_chunk_borders", false) then
for x0 = minp.x, maxp.x, step do for x0 = minp.x, maxp.x, step do
for y0 = minp.y, maxp.y, step do for y0 = minp.y, maxp.y, step do
minetest.set_node({x=x0, y=y0, z=maxp.z}, {name = "mcl_core:glass"}) minetest.set_node({x=x0, y=y0, z=maxp.z}, {name = "mcl_core:glass"})
@ -56,5 +58,12 @@ mcl_mapgen.register_mapgen(function(minp, maxp, seed, vm_context)
minetest.set_node({x=maxp.x, y=y0, z=z0}, {name = "mcl_core:glass"}) minetest.set_node({x=maxp.x, y=y0, z=z0}, {name = "mcl_core:glass"})
end end
end end
for z0 = minp.z, maxp.z, step do
for x0 = minp.x, maxp.x, step do
minetest.set_node({x=x0, y=maxp.y, z=z0}, {name = "mcl_core:glass"})
end end
end, -1) end
if not minetest.settings:get_bool("mcl_debug_struct_noise", false) then
end
end
end, 999999999999)

View File

@ -11,7 +11,7 @@ if not mcl_mapgen.singlenode then
dofile(modpath .. "/ice_spike_large.lua") dofile(modpath .. "/ice_spike_large.lua")
dofile(modpath .. "/jungle_temple.lua") dofile(modpath .. "/jungle_temple.lua")
dofile(modpath .. "/nice_jungle_temple.lua") dofile(modpath .. "/nice_jungle_temple.lua")
-- dofile(modpath .. "/noise_indicator.lua") dofile(modpath .. "/noise_indicator.lua")
dofile(modpath .. "/stronghold.lua") dofile(modpath .. "/stronghold.lua")
dofile(modpath .. "/witch_hut.lua") dofile(modpath .. "/witch_hut.lua")
end end

View File

@ -168,3 +168,5 @@ kick_threshold (Cheat Kicking Threshold) int 10
[Debugging] [Debugging]
# If enabled, this will show the itemstring of an item in the description. # If enabled, this will show the itemstring of an item in the description.
mcl_item_id_debug (Item ID Debug) bool false mcl_item_id_debug (Item ID Debug) bool false
mcl_debug_struct_noise (Show Structures Perlin Noise) bool false
mcl_debug_chunk_borders (Show Chunk Borders) bool false