Fixed right_click issue for placing seed/crop inside itemframes (thanks Krock)

This commit is contained in:
TenPlus1 2016-10-14 14:48:27 +01:00
parent c23ccadbb8
commit 62246da3b8
1 changed files with 11 additions and 2 deletions

View File

@ -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,
})