tweak decomposition rng.
leaves now have a higher chance of turning into dirt, the higher they're piled within the node. full stacks (taking up an entire node) always turn into dirt.
This commit is contained in:
parent
4b408d9943
commit
5014254c91
|
@ -36,8 +36,6 @@ local decompose_group_scores = {
|
|||
|
||||
local decompose_cost = 2000
|
||||
|
||||
local average_leaves_per_dirt = 4
|
||||
|
||||
blockgame.register_increasing_abm({
|
||||
id = modname .. ":decompose",
|
||||
label = "decompose leaves",
|
||||
|
@ -80,7 +78,12 @@ blockgame.register_increasing_abm({
|
|||
return data.value >= decompose_cost
|
||||
end,
|
||||
action = function (pos, node, data)
|
||||
if blockgame.chance(average_leaves_per_dirt) then
|
||||
-- currently, larger leaf piles have a greater chance of turning into dirt instead of disappearing.
|
||||
-- might wanna make it so that instead, dirt is layered as well?
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
local dirt_chance = def.level_max - def.level + 1
|
||||
|
||||
if blockgame.chance(dirt_chance) then
|
||||
minetest.set_node(pos, {name = "bg_terrain:dirt"})
|
||||
else
|
||||
minetest.remove_node(pos)
|
||||
|
|
Loading…
Reference in New Issue