forked from mtcontrib/minetest-mod-snow
Fix missing snow leaves and apple leavesdecay
This commit is contained in:
parent
600eaa2313
commit
0dcf9b5f0e
|
@ -241,7 +241,6 @@ nodedef = {
|
|||
groups = leaves.groups,
|
||||
drop = leaves.drop,
|
||||
sounds = leaves.sounds,
|
||||
on_timer = leaves.on_timer, -- timer from leafdecay
|
||||
}
|
||||
nodedef.groups.flammable = 1
|
||||
|
||||
|
@ -267,16 +266,12 @@ nodedef.groups.flammable = 1
|
|||
minetest.register_node("snow:apple", nodedef)
|
||||
snow.known_plants[minetest.get_content_id("default:apple")] = minetest.get_content_id("snow:apple")
|
||||
|
||||
local dec_func = leafdecay_after_destruct
|
||||
function leafdecay_after_destruct(pos, oldnode, def)
|
||||
if def.trunks[1] ~= "default:tree" then
|
||||
return dec_func(pos, oldnode, def)
|
||||
end
|
||||
def.leaves[#def.leaves+1] = "snow:leaves"
|
||||
def.leaves[#def.leaves+1] = "snow:apple"
|
||||
leafdecay_after_destruct = dec_func
|
||||
return leafdecay_after_destruct(pos, oldnode, def)
|
||||
end
|
||||
-- decay from default/nodes.lua:2537
|
||||
default.register_leafdecay{
|
||||
trunks = {"default:tree"},
|
||||
leaves = {"snow:apple", "snow:leaves"},
|
||||
radius = minetest.get_mapgen_setting"mg_name" == "v6" and 2 or 3,
|
||||
}
|
||||
|
||||
-- TODO
|
||||
snow.known_plants[minetest.get_content_id("default:jungleleaves")] = minetest.get_content_id("default:jungleleaves")
|
||||
|
|
Loading…
Reference in New Issue
Block a user