From 6db5d97d176ee64cfd079e08e762964036c4c77d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 1 Mar 2017 16:55:48 +0100 Subject: [PATCH] Rightclick takes precedence over water grabbing --- mods/ITEMS/mcl_potions/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index bc92e1644b..c83483b2b4 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -22,6 +22,14 @@ minetest.register_craftitem("mcl_potions:glass_bottle", { if pointed_thing.type == "node" then local node = minetest.get_node(pointed_thing.under) local def = minetest.registered_nodes[node.name] + + -- Call on_rightclick if the pointed node defines it + if placer and not placer :get_player_control().sneak then + if def and def.on_rightclick then + return def.on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack + end + end + -- Try to fill glass bottle with water -- TODO: Also support cauldrons if def.groups and def.groups.water and def.liquidtype == "source" then