1
0
mirror of https://github.com/mt-mods/moretrees.git synced 2025-01-13 11:20:25 +01:00

try out lsystem decoration

This commit is contained in:
wsor4035 2024-10-17 21:45:01 -04:00
parent c15250a03a
commit 1727fb32bb

View File

@ -134,7 +134,6 @@ function translate_biome_defs(def, treename, index)
if not index then index = 1 end
local deco_def = {
name = treename .. "_" .. index,
deco_type = "simple",
place_on = def.place_on,
sidelen = 16,
fill_ratio = def.fill_ratio or 0.001,
@ -143,9 +142,16 @@ function translate_biome_defs(def, treename, index)
y_max = def.max_elevation,
spawn_by = def.spawn_by,
num_spawn_by = def.num_spawn_by,
decoration = "moretrees:"..treename.."_sapling_ongen"
}
if minetest.features.lsystem_decoration_type then
deco_def.deco_type = "lsystem"
deco_def.treedef = moretrees[treename .. "_model"]
else
deco_def.deco_type = "simple"
deco_def.decoration = "moretrees:"..treename.."_sapling_ongen"
end
deco_ids[#deco_ids+1] = treename .. ("_" .. index or "_1")
return deco_def
@ -176,6 +182,7 @@ minetest.register_decoration(translate_biome_defs(moretrees.poplar_biome_3, "pop
minetest.register_decoration(translate_biome_defs(moretrees.poplar_small_biome, "poplar_small", 4))
minetest.register_decoration(translate_biome_defs(moretrees.poplar_small_biome_2, "poplar_small", 5))
if not minetest.features.lsystem_decoration_type then
--[[
this is purposefully wrapped in a on mods loaded callback to that it gets the proper ids
if other mods clear the registered decorations
@ -203,6 +210,7 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
timer:start(math.random(2,10))
end
end)
end
-- Code to spawn a birch tree