3 - Move coral bones deco id to biome specific file

This commit is contained in:
Juraj Vajda 2023-02-22 15:43:07 +00:00
commit 23012e3e18
2 changed files with 19 additions and 13 deletions

View File

@ -36,16 +36,10 @@ local deco_ids_baobab = {
minetest.get_decoration_id('everness:baobab_savanna_baobab_tree_2')
}
local deco_id_coral_bones_tree = minetest.get_decoration_id('everness:coral_forest_coral_bones_tree')
if #deco_ids_baobab > 1 then
minetest.set_gen_notify('decoration', deco_ids_baobab)
end
if deco_id_coral_bones_tree then
minetest.set_gen_notify('decoration', { deco_id_coral_bones_tree })
end
-- Localise data buffer table outside the loop, to be re-used for all
-- mapchunks, therefore minimising memory use.
local data = {}
@ -78,13 +72,6 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
end
end
--
-- Coral bone tree - fix light
--
for _, pos in ipairs(gennotify['decoration#' .. deco_id_coral_bones_tree] or {}) do
minetest.fix_light(vector.offset(pos, -1, -1, -1), vector.offset(pos, 14, 35, 14))
end
--
-- Bamboo
--

View File

@ -213,3 +213,22 @@ register_coral_grass_decoration(-0.015, 0.075, 4)
register_coral_grass_decoration(0, 0.06, 3)
register_coral_grass_decoration(0.015, 0.045, 2)
register_coral_grass_decoration(0.03, 0.03, 1)
--
-- On Generated
--
local deco_id_coral_bones_tree = minetest.get_decoration_id('everness:coral_forest_coral_bones_tree')
minetest.set_gen_notify('decoration', { deco_id_coral_bones_tree })
minetest.register_on_generated(function(minp, maxp, blockseed)
local gennotify = minetest.get_mapgen_object('gennotify')
--
-- Coral bone tree - fix light
--
for _, pos in ipairs(gennotify['decoration#' .. deco_id_coral_bones_tree] or {}) do
minetest.fix_light(vector.offset(pos, -1, -1, -1), vector.offset(pos, 14, 35, 14))
end
end)