Spawn egg, boat, cart, book use node rightclick
This commit is contained in:
parent
711ec5f38c
commit
b68224a38d
4 changed files with 46 additions and 0 deletions
|
@ -2821,6 +2821,14 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
|
|||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
|
||||
-- Call on_rightclick if the pointed node defines it
|
||||
local node = minetest.get_node(pointed_thing.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 pos = pointed_thing.above
|
||||
|
||||
if pos
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue