From c0a5c63601593df0c9f4449d3845d82f2d745511 Mon Sep 17 00:00:00 2001 From: Eliy21 Date: Sun, 21 Jan 2024 08:43:02 +0000 Subject: [PATCH] Fix sus stew item frame duplication bug --- mods/ITEMS/mcl_sus_stew/init.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mods/ITEMS/mcl_sus_stew/init.lua b/mods/ITEMS/mcl_sus_stew/init.lua index 02565757c..d34dbbf00 100644 --- a/mods/ITEMS/mcl_sus_stew/init.lua +++ b/mods/ITEMS/mcl_sus_stew/init.lua @@ -79,6 +79,21 @@ local function eat_stew(itemstack, user, pointed_thing) end local function eat_stew_delayed(itemstack, user, pointed_thing) + + if pointed_thing.type == "node" then + if user and not user:get_player_control().sneak then + -- Use pointed node's on_rightclick function first, if present + local node = minetest.get_node(pointed_thing.under) + if user and not user: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, user, itemstack) or itemstack + end + end + end + elseif pointed_thing.type == "object" then + return itemstack + end + -- Wrapper for handling mcl_hunger delayed eating local name = user:get_player_name() mcl_hunger.eat_internal[name]._custom_itemstack = itemstack -- Used as comparison to make sure the custom wrapper executes only when the same item is eaten