1
0
mirror of https://github.com/Splizard/minetest-mod-snow.git synced 2024-12-27 15:10:20 +01:00

Fix missing snow leaves and apple leavesdecay

This commit is contained in:
Hybrid Dog 2017-12-17 12:10:47 +01:00
parent 600eaa2313
commit 0dcf9b5f0e

View File

@ -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")