Réécriture de la récolte des fougères arborescentes.

* Cette réécriture emploi une méthode similaire à la récolte du papyrus.
This commit is contained in:
Sys Quatre 2019-04-12 20:01:22 +02:00
parent 8b42a45d78
commit 5dfa02c037
2 changed files with 13 additions and 12 deletions

View File

@ -252,10 +252,14 @@ minetest.register_node("ferns:fern_trunk_big", {
},
groups = {tree=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
after_destruct = function(pos,oldnode)
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
if node.name == "ferns:fern_trunk_big" or node.name == "ferns:fern_trunk_big_top" then
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
after_dig_node = function(pos, node, metadata, digger)
if digger == nil then return end
local np = {x=pos.x,y=pos.y+1,z=pos.z}
local nn = minetest.get_node(np)
if nn.name == "ferns:fern_trunk_big" or
nn.name == "ferns:fern_trunk_big_top"
then
minetest.node_dig(np, nn, digger)
end
end,
})

View File

@ -138,11 +138,8 @@ minetest.register_node("ferns:fern_trunk", {
},
groups = {tree=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
after_destruct = function(pos,oldnode)
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
if node.name == "ferns:fern_trunk" then
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
end
after_dig_node = function(pos, node, metadata, digger)
default.dig_up(pos, node, digger)
end,
})