From a154cb990495591e1687a81d94629808953f88cb Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:52:29 +0200 Subject: [PATCH] disable some logging --- plantlife_lib/init.lua | 45 +++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/plantlife_lib/init.lua b/plantlife_lib/init.lua index 47abddc..55f5ee7 100644 --- a/plantlife_lib/init.lua +++ b/plantlife_lib/init.lua @@ -10,8 +10,8 @@ function pl.get_def_from_id(id) end function pl.register_on_generate(def, plantname, index, func) - if not index then index = 1 end - local deco_def = { + if not index then index = 1 end -- Do we need `index`? + local deco_def = { -- This needs some good values (and noise param support) name = plantname .. "_" .. index, deco_type = "simple", place_on = def.place_on or def.surface, @@ -33,15 +33,15 @@ end local ids = {} minetest.register_on_mods_loaded(function() - print(dump(deco)) + -- print(dump(deco)) for k, v in pairs(deco) do local id = minetest.get_decoration_id(deco[k][1].name) deco[k][1].id = id table.insert(ids, id) end - print(dump2(ids)) + -- print(dump2(ids)) minetest.set_gen_notify("decoration", ids) - print(dump2(deco)) + -- print(dump(deco)) end) minetest.register_on_generated(function(minp, maxp, blockseed) @@ -49,9 +49,9 @@ minetest.register_on_generated(function(minp, maxp, blockseed) local locations = {} for _, id in pairs(ids) do local deco_locations = g["decoration#" .. id] or {} - print("dl: " .. dump2(deco_locations)) + -- print("dl: " .. dump2(deco_locations)) for k, pos in pairs(deco_locations) do - print(id) + -- print(id) local next = #locations + 1 locations[next] = {} locations[next].pos = pos @@ -60,13 +60,34 @@ minetest.register_on_generated(function(minp, maxp, blockseed) end end if #locations == 0 then return end - print("locations: " .. dump2(locations)) + -- print("locations: " .. dump2(locations)) for _, t in ipairs(locations) do local def = pl.get_def_from_id(t.id) local spawn_func = def[2] spawn_func(t.pos) - abstract_bushes.grow_bush(t.pos) - local player = minetest.get_player_by_name("Niklp") - player:set_pos(t.pos) + -- local player = minetest.get_player_by_name("Niklp") + -- player:set_pos(t.pos) end -end) \ No newline at end of file +end) + +--[[ Example plant +{ + { + y_min = 1, + decoration = "air", + deco_type = "simple", + id = 45, + name = "bushes:bushes_1", + place_on = { + "default:dirt_with_grass", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + sidelen = 16, + fill_ratio = 0.001 + }, + ^ - decoration def; object ID + +}, ^ - spawn function +]]-- \ No newline at end of file