From e9f9d96eb1f7acced6e8d477b7ea45736f54e0c7 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Tue, 26 Jan 2021 17:42:45 +0100 Subject: [PATCH] Fix #1012 --- mods/ITEMS/mcl_core/craftitems.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mods/ITEMS/mcl_core/craftitems.lua b/mods/ITEMS/mcl_core/craftitems.lua index b27a6ca6..7cffcb78 100644 --- a/mods/ITEMS/mcl_core/craftitems.lua +++ b/mods/ITEMS/mcl_core/craftitems.lua @@ -147,6 +147,17 @@ minetest.register_craftitem("mcl_core:apple", { local gapple_hunger_restore = minetest.item_eat(4) local function eat_gapple(itemstack, placer, pointed_thing) + if pointed_thing.type == "node" then + local node = minetest.get_node(pointed_thing.under) + if placer and not placer:get_player_control().sneak then + if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then + return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack + end + end + elseif pointed_thing.type == "object" then + return itemstack + end + local regen_duration, absorbtion_factor = 5, 1 if itemstack:get_name() == "mcl_core:apple_gold_enchanted" then regen_duration, absorbtion_factor = 20, 4