mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-05 01:50:25 +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)
|
||||
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({
|
||||
nodenames = {"group:leafdecay"},
|
||||
neighbors = {"air", "group:liquid"},
|
||||
|
|
|
@ -477,6 +477,7 @@ minetest.register_node("default:jungleleaves", {
|
|||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
minetest.register_node("default:junglesapling", {
|
||||
|
@ -539,6 +540,7 @@ minetest.register_node("default:leaves", {
|
|||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
minetest.register_node("default:cactus", {
|
||||
|
@ -607,7 +609,8 @@ minetest.register_node("default:bookshelf", {
|
|||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
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
|
||||
return 1
|
||||
else
|
||||
|
@ -2149,6 +2152,7 @@ minetest.register_node("default:pine_needles",{
|
|||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
after_place_node = default.after_place_leaves,
|
||||
})
|
||||
|
||||
minetest.register_node("default:pine_sapling", {
|
||||
|
|
Loading…
Reference in New Issue
Block a user