mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-26 01:30:29 +01:00
Merge "Set param2 to 1 if player places leaves"
This commit is contained in:
parent
87f013bf28
commit
7126d2af7f
@ -352,6 +352,12 @@ minetest.register_globalstep(function(dtime)
|
|||||||
math.floor(dtime * finds_per_second)
|
math.floor(dtime * finds_per_second)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
node.param2 = 1
|
||||||
|
minetest.set_node(pos, node)
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"group:leafdecay"},
|
nodenames = {"group:leafdecay"},
|
||||||
neighbors = {"air", "group:liquid"},
|
neighbors = {"air", "group:liquid"},
|
||||||
|
@ -477,6 +477,7 @@ minetest.register_node("default:jungleleaves", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
after_place_node = default.after_place_leaves,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("default:junglesapling", {
|
minetest.register_node("default:junglesapling", {
|
||||||
@ -539,6 +540,7 @@ minetest.register_node("default:leaves", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
after_place_node = default.after_place_leaves,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("default:cactus", {
|
minetest.register_node("default:cactus", {
|
||||||
@ -607,7 +609,8 @@ minetest.register_node("default:bookshelf", {
|
|||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if listname == "books" then
|
local to_stack = inv:get_stack(listname, index)
|
||||||
|
if listname == "books" and to_stack:is_empty() then
|
||||||
if stack:get_name() == "default:book" then
|
if stack:get_name() == "default:book" then
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
@ -2149,6 +2152,7 @@ minetest.register_node("default:pine_needles",{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
after_place_node = default.after_place_leaves,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("default:pine_sapling", {
|
minetest.register_node("default:pine_sapling", {
|
||||||
|
Loading…
Reference in New Issue
Block a user