From: Zeg9 Date: Sat, 1 Jun 2013 11:40:02 +0000 (+0200) Subject: Call on_rightclick from buckets X-Git-Tag: 0.4.8~25 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9bbde070a132f3d11e67b51138dbb4e5b772862e;p=oweals%2Fminetest_game.git Call on_rightclick from buckets --- diff --git a/mods/bucket/init.lua b/mods/bucket/init.lua index 5843bf77..c3f20b3a 100644 --- a/mods/bucket/init.lua +++ b/mods/bucket/init.lua @@ -44,6 +44,15 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name if pointed_thing.type ~= "node" then return 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) if math.floor(fullness/128) == 1 or (not minetest.setting_getbool("liquid_finite")) then