Fix crash when placing cocoa beans in item frame
This commit is contained in:
parent
b68224a38d
commit
064bf1effe
|
@ -17,11 +17,11 @@ function mcl_cocoas.place(itemstack, placer, pointed_thing, plantname)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- am I right-clicking on something that has a custom on_place set?
|
-- Am I right-clicking on something that has a custom on_rightclick set?
|
||||||
-- thanks to Krock for helping with this issue :)
|
if placer and not placer:get_player_control().sneak then
|
||||||
local def = minetest.registered_nodes[under.name]
|
if minetest.registered_nodes[under.name] and minetest.registered_nodes[under.name].on_rightclick then
|
||||||
if def and def.on_rightclick then
|
return minetest.registered_nodes[under.name].on_rightclick(pointed_thing.under, under, placer, itemstack) or itemstack
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check if pointing at jungle tree
|
-- Check if pointing at jungle tree
|
||||||
|
|
|
@ -229,7 +229,7 @@ minetest.register_craftitem("mcl_dye:brown", {
|
||||||
description = "Cocoa Beans",
|
description = "Cocoa Beans",
|
||||||
stack_max = 64,
|
stack_max = 64,
|
||||||
groups = dyelocal.dyes[4][3],
|
groups = dyelocal.dyes[4][3],
|
||||||
on_place = function(itemstack, user, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
return mcl_cocoas.place(itemstack, placer, pointed_thing, "mcl_cocoas:cocoa_1")
|
return mcl_cocoas.place(itemstack, placer, pointed_thing, "mcl_cocoas:cocoa_1")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue