mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2024-11-14 22:50:27 +01:00
use custom is_ground_content method
This commit is contained in:
parent
13c75410aa
commit
85ab92f32d
|
@ -300,4 +300,5 @@ subterrane.register_layer({
|
||||||
decorate = decorate_level_1,
|
decorate = decorate_level_1,
|
||||||
warren_region_variability_threshold = 0.33,
|
warren_region_variability_threshold = 0.33,
|
||||||
double_frequency = true,
|
double_frequency = true,
|
||||||
|
is_ground_content = df_caverns.is_ground_content,
|
||||||
})
|
})
|
|
@ -375,5 +375,6 @@ subterrane.register_layer({
|
||||||
decorate = decorate_level_2,
|
decorate = decorate_level_2,
|
||||||
warren_region_variability_threshold = 0.33,
|
warren_region_variability_threshold = 0.33,
|
||||||
double_frequency = true,
|
double_frequency = true,
|
||||||
|
is_ground_content = df_caverns.is_ground_content,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -527,4 +527,5 @@ subterrane.register_layer({
|
||||||
decorate = decorate_level_3,
|
decorate = decorate_level_3,
|
||||||
warren_region_variability_threshold = 0.33,
|
warren_region_variability_threshold = 0.33,
|
||||||
double_frequency = true,
|
double_frequency = true,
|
||||||
|
is_ground_content = df_caverns.is_ground_content,
|
||||||
})
|
})
|
||||||
|
|
|
@ -286,4 +286,5 @@ subterrane.register_layer({
|
||||||
},
|
},
|
||||||
decorate = decorate_primordial,
|
decorate = decorate_primordial,
|
||||||
double_frequency = true,
|
double_frequency = true,
|
||||||
|
is_ground_content = df_caverns.is_ground_content,
|
||||||
})
|
})
|
||||||
|
|
|
@ -208,3 +208,33 @@ df_caverns.place_shrub = function(vi, area, data, param2_data, shrub_list)
|
||||||
local shrub = shrub_list[math.random(#shrub_list)]
|
local shrub = shrub_list[math.random(#shrub_list)]
|
||||||
shrub(vi, area, data, param2_data)
|
shrub(vi, area, data, param2_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
-- This method allows subterrane to overgenerate caves without destroying any of the decorations
|
||||||
|
-- Water is included so that the sunless sea won't have gaps torn in it
|
||||||
|
local dfcaverns_nodes = nil
|
||||||
|
local dfcaverns_mods = {
|
||||||
|
"df_farming:",
|
||||||
|
"df_mapitems:",
|
||||||
|
"df_primordial_items:",
|
||||||
|
"df_trees:",
|
||||||
|
"df_underworld_items:",
|
||||||
|
"ice_sprites:",
|
||||||
|
"mine_gas:",
|
||||||
|
"default:water",
|
||||||
|
}
|
||||||
|
df_caverns.is_ground_content = function(c_node)
|
||||||
|
if dfcaverns_nodes then
|
||||||
|
return not dfcaverns_nodes[c_node]
|
||||||
|
end
|
||||||
|
dfcaverns_nodes = {}
|
||||||
|
for k, v in pairs(minetest.registered_nodes) do
|
||||||
|
for _, prefix in ipairs(dfcaverns_mods) do
|
||||||
|
if k:sub(1, #prefix) == prefix then
|
||||||
|
dfcaverns_nodes[minetest.get_content_id(k)] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
dfcaverns_mods = nil
|
||||||
|
return not dfcaverns_nodes[c_node]
|
||||||
|
end
|
|
@ -401,4 +401,5 @@ subterrane.register_layer({
|
||||||
},
|
},
|
||||||
decorate = decorate_sunless_sea,
|
decorate = decorate_sunless_sea,
|
||||||
double_frequency = false,
|
double_frequency = false,
|
||||||
|
is_ground_content = df_caverns.is_ground_content,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user