Node on_rightclick: bed, bucket, lilypad, sign
This commit is contained in:
parent
9cb2f5b392
commit
b31405307d
4 changed files with 42 additions and 9 deletions
|
@ -207,6 +207,15 @@ minetest.register_node("signs:sign_wall", {
|
|||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local above = pointed_thing.above
|
||||
local under = pointed_thing.under
|
||||
|
||||
-- Use pointed node's on_rightclick function first, if present
|
||||
local node = minetest.get_node(under)
|
||||
if placer and not placer:get_player_control().sneak then
|
||||
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
|
||||
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
||||
end
|
||||
end
|
||||
|
||||
local dir = {x = under.x - above.x,
|
||||
y = under.y - above.y,
|
||||
z = under.z - above.z}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue