From 62246da3b8edaf77b5eb1b5393469720f4cbb598 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Fri, 14 Oct 2016 14:48:27 +0100 Subject: [PATCH] Fixed right_click issue for placing seed/crop inside itemframes (thanks Krock) --- init.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 922be4a..4c3b945 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ --[[ - Minetest Farming Redo Mod 1.22 (4th June 2016) + Minetest Farming Redo Mod 1.23 (14th October 2016) by TenPlus1 NEW growing routine by prestidigitator auto-refill by crabman77 @@ -538,6 +538,14 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) end local under = minetest.get_node(pt.under) + + -- am I right-clicking on something that has a custom on_place set? + -- thanks to Krock for helping with this issue :) + local def = minetest.registered_nodes[under.name] + if def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack) + end + local above = minetest.get_node(pt.above) -- check if pointing at the top of the node @@ -623,7 +631,8 @@ farming.register_plant = function(name, def) selection_box = farming.select, on_place = function(itemstack, placer, pointed_thing) - return farming.place_seed(itemstack, placer, pointed_thing, mname .. ":"..pname.."_1") + return farming.place_seed(itemstack, placer, + pointed_thing, mname .. ":" .. pname .. "_1") end, })