Skip to content

Commit 9bbde07

Browse files
Zeg9PilzAdam
authored andcommittedJul 11, 2013
Call on_rightclick from buckets
1 parent 6fed686 commit 9bbde07

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎mods/bucket/init.lua

+9
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
4444
if pointed_thing.type ~= "node" then
4545
return
4646
end
47+
48+
-- Call on_rightclick if the pointed node defines it
49+
if user and not user:get_player_control().sneak then
50+
local n = minetest.get_node(pointed_thing.under)
51+
local nn = n.name
52+
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then
53+
return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, user, itemstack) or itemstack
54+
end
55+
end
4756

4857
local place_liquid = function(pos, node, source, flowing, fullness)
4958
if math.floor(fullness/128) == 1 or (not minetest.setting_getbool("liquid_finite")) then

0 commit comments

Comments
 (0)