From 064bf1effe9e88c0e9825b1fc266d254a9d4fc6d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 2 Mar 2017 15:50:53 +0100 Subject: [PATCH] Fix crash when placing cocoa beans in item frame --- mods/ITEMS/mcl_cocoas/init.lua | 10 +++++----- mods/ITEMS/mcl_dye/init.lua | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_cocoas/init.lua b/mods/ITEMS/mcl_cocoas/init.lua index bc596042..6edc9329 100644 --- a/mods/ITEMS/mcl_cocoas/init.lua +++ b/mods/ITEMS/mcl_cocoas/init.lua @@ -17,11 +17,11 @@ function mcl_cocoas.place(itemstack, placer, pointed_thing, plantname) return end - -- 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) + -- Am I right-clicking on something that has a custom on_rightclick set? + if placer and not placer:get_player_control().sneak then + if minetest.registered_nodes[under.name] and minetest.registered_nodes[under.name].on_rightclick then + return minetest.registered_nodes[under.name].on_rightclick(pointed_thing.under, under, placer, itemstack) or itemstack + end end -- Check if pointing at jungle tree diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index fea19b29..4b66f290 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -229,7 +229,7 @@ minetest.register_craftitem("mcl_dye:brown", { description = "Cocoa Beans", stack_max = 64, 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") end, })