2d3b468c65
- Eggcorn cleanup. They look a little better falling out of the tree, and we don't have so many now. - Crushing damage fixes. Crushing is nuanced now, and most things don't smush you, and many do reduced damage. A few may do more. - Item stack convenience. Items landing on a stack or right- clicked onto one attempt to merge into it. - Ladders now fall (they don't connect to sides). Use the new full-scale frames for ones that don't.
21 lines
688 B
Lua
21 lines
688 B
Lua
-- LUALOCALS < ---------------------------------------------------------
|
|
local ipairs, minetest, nodecore
|
|
= ipairs, minetest, nodecore
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
nodecore.register_leaf_drops, nodecore.registered_leaf_drops
|
|
= nodecore.mkreg()
|
|
|
|
function nodecore.leaf_decay(pos, node)
|
|
node = node or minetest.get_node(pos)
|
|
local t = {}
|
|
for i, v in ipairs(nodecore.registered_leaf_drops) do
|
|
t = v(pos, node, t) or t
|
|
end
|
|
local p = nodecore.pickrand(t, function(x) return x.prob end)
|
|
if not p then return end
|
|
minetest.set_node(pos, p)
|
|
if p.item then nodecore.item_eject(pos, p.item) end
|
|
return minetest.check_for_falling(pos)
|
|
end
|