diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2016-10-14 14:48:27 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2016-10-14 14:48:27 +0100 |
commit | 62246da3b8edaf77b5eb1b5393469720f4cbb598 (patch) | |
tree | 7c091ec32e9e5f41feb5994250b148686cbc6809 /init.lua | |
parent | c23ccadbb8deb1b2e998c37bf8a2559adb04a454 (diff) |
Fixed right_click issue for placing seed/crop inside itemframes (thanks Krock)
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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, }) |