fix puzzle seal formspec for mcl

This commit is contained in:
FaceDeer
2022-08-09 22:35:37 -06:00
parent 82c4950715
commit 56850bb7e7
11 changed files with 56 additions and 10 deletions

View File

@ -53,6 +53,14 @@ local wave_mult = 10
local y_max = median + 2*wave_mult + -2*ceiling_mult + ceiling_displace
local y_min = median - 2*wave_mult - 2*floor_mult + floor_displace
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y > y_max or pos.y < y_min then
return
end
-- TODO: account for perlin noise
return "lava_sea"
end)
minetest.register_on_generated(function(minp, maxp, seed)
--if out of range of cave definition limits, abort
if minp.y > y_max or maxp.y < y_min then

View File

@ -46,7 +46,7 @@ local get_biome = function(heat, humidity)
end
end
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.level1_min or pos.y > df_caverns.config.ymax then
return nil
end

View File

@ -47,7 +47,7 @@ local get_biome = function(heat, humidity)
end
end
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.level2_min or pos.y >= df_caverns.config.level1_min then
return nil
end

View File

@ -41,7 +41,7 @@ local get_biome = function(heat, humidity)
end
end
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.level3_min or pos.y >= df_caverns.config.level2_min then
return nil
end

View File

@ -46,6 +46,14 @@ local c_lava_set
local y_max = median + 2*wave_mult + 2*ceiling_mult + ceiling_displace
local y_min = median - 2*wave_mult + 2*floor_mult + floor_displace
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y > y_max or pos.y < y_min then
return
end
-- TODO: account for perlin noise
return "oil_sea"
end)
minetest.register_on_generated(function(minp, maxp, seed)
--if out of range of cave definition limits, abort
if minp.y > y_max or maxp.y < y_min then

View File

@ -29,7 +29,7 @@ local perlin_wave_primordial = {
local giant_mycelium_timer_spread = tonumber(minetest.settings:get("dcaverns_giant_mycelium_timer_spread")) or 10
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.primordial_min or pos.y > df_caverns.config.primordial_max then
return nil
end

View File

@ -23,11 +23,14 @@ local c_webs_egg = df_caverns.node_id.big_webs_egg
df_caverns.data_param2 = {} -- shared among all mapgens to reduce memory clutter
df_caverns.get_biome_at_pos_list = {} -- a list of methods of the form function(pos, heat, humidity) to allow modpack-wide queries about what should grow where
local get_biome_at_pos_list = {} -- a list of methods of the form function(pos, heat, humidity) to allow modpack-wide queries about what should grow where
df_caverns.register_biome_check = function(func)
table.insert(get_biome_at_pos_list, func)
end
df_caverns.get_biome = function(pos)
local heat = minetest.get_heat(pos)
local humidity = minetest.get_humidity(pos)
for _, val in pairs(df_caverns.get_biome_at_pos_list) do
for _, val in pairs(get_biome_at_pos_list) do
local biome = val(pos, heat, humidity)
if biome ~= nil then
return biome

View File

@ -99,7 +99,7 @@ local hot_zone_boundary = 70
local middle_zone_boundary = 50
local cool_zone_boundary = 30
table.insert(df_caverns.get_biome_at_pos_list, function(pos, heat, humidity)
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y < df_caverns.config.sunless_sea_min or pos.y >= df_caverns.config.level3_min then
return nil
end

View File

@ -333,6 +333,14 @@ minetest.register_chatcommand("find_pit", {
end,
})
df_caverns.register_biome_check(function(pos, heat, humidity)
if pos.y > y_max or pos.y < y_min then
return
end
-- TODO: account for perlin noise
return "underworld"
end)
minetest.register_on_generated(function(minp, maxp, seed)
--if out of range of cave definition limits, abort