mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-23 07:10:19 +01:00
Call on_rightclick from buckets
This commit is contained in:
parent
6fed6867cb
commit
9bbde070a1
@ -45,6 +45,15 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Call on_rightclick if the pointed node defines it
|
||||||
|
if user and not user:get_player_control().sneak then
|
||||||
|
local n = minetest.get_node(pointed_thing.under)
|
||||||
|
local nn = n.name
|
||||||
|
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then
|
||||||
|
return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, user, itemstack) or itemstack
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local place_liquid = function(pos, node, source, flowing, fullness)
|
local place_liquid = function(pos, node, source, flowing, fullness)
|
||||||
if math.floor(fullness/128) == 1 or (not minetest.setting_getbool("liquid_finite")) then
|
if math.floor(fullness/128) == 1 or (not minetest.setting_getbool("liquid_finite")) then
|
||||||
minetest.add_node(pos, {name=source, param2=fullness})
|
minetest.add_node(pos, {name=source, param2=fullness})
|
||||||
|
Loading…
Reference in New Issue
Block a user