From 64c04a2f0abd0491a49b6f681d5c70bd4818b667 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Tue, 27 Aug 2024 05:55:57 -0500 Subject: [PATCH 1/4] Fix #4613 --- mods/ITEMS/mcl_honey/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/ITEMS/mcl_honey/init.lua b/mods/ITEMS/mcl_honey/init.lua index a870e7c08..127c788b0 100644 --- a/mods/ITEMS/mcl_honey/init.lua +++ b/mods/ITEMS/mcl_honey/init.lua @@ -19,6 +19,9 @@ function mcl_honey.wax_block(pos, node, player, itemstack) if def and def._mcl_waxed_variant then node.name = def._mcl_waxed_variant else + if def.on_rightclick then + return def.on_rightclick(pos, node, player, itemstack) + end return end From f9cd2500c039abd783f95c4f603a4f9b94b16f0f Mon Sep 17 00:00:00 2001 From: teknomunk Date: Tue, 27 Aug 2024 17:39:41 -0500 Subject: [PATCH 2/4] Don't crash trying to right click unknown nodes while holding honeycomb --- mods/ITEMS/mcl_honey/init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_honey/init.lua b/mods/ITEMS/mcl_honey/init.lua index 127c788b0..7f39a3c59 100644 --- a/mods/ITEMS/mcl_honey/init.lua +++ b/mods/ITEMS/mcl_honey/init.lua @@ -18,10 +18,9 @@ function mcl_honey.wax_block(pos, node, player, itemstack) if def and def._mcl_waxed_variant then node.name = def._mcl_waxed_variant + elseif def and def.on_rightclick then + return def.on_rightclick(pos, node, player, itemstack) else - if def.on_rightclick then - return def.on_rightclick(pos, node, player, itemstack) - end return end From f10827d0d63402774a36244690a0e9309736fa72 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Wed, 28 Aug 2024 18:08:43 -0500 Subject: [PATCH 3/4] Rework code --- mods/ITEMS/mcl_honey/init.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/mcl_honey/init.lua b/mods/ITEMS/mcl_honey/init.lua index 7f39a3c59..32abbae44 100644 --- a/mods/ITEMS/mcl_honey/init.lua +++ b/mods/ITEMS/mcl_honey/init.lua @@ -15,15 +15,13 @@ function mcl_honey.wax_block(pos, node, player, itemstack) end local def = minetest.registered_nodes[node.name] + if not def then return end - if def and def._mcl_waxed_variant then - node.name = def._mcl_waxed_variant - elseif def and def.on_rightclick then + if def.on_rightclick then return def.on_rightclick(pos, node, player, itemstack) - else - return end + if not def._mcl_waxed_variant then return end node.name = def._mcl_waxed_variant minetest.set_node(pos, node) awards.unlock(player:get_player_name(), "mcl:wax_on") From 3e85736404654e8543df7b2866ce063d4acb19c7 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Sat, 31 Aug 2024 06:51:51 -0500 Subject: [PATCH 4/4] Change honeycomb to use same right-click logic recently added to buckets and bottles --- mods/ITEMS/mcl_honey/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_honey/init.lua b/mods/ITEMS/mcl_honey/init.lua index 32abbae44..9aa5167f5 100644 --- a/mods/ITEMS/mcl_honey/init.lua +++ b/mods/ITEMS/mcl_honey/init.lua @@ -17,9 +17,9 @@ function mcl_honey.wax_block(pos, node, player, itemstack) local def = minetest.registered_nodes[node.name] if not def then return end - if def.on_rightclick then - return def.on_rightclick(pos, node, player, itemstack) - end + -- Handle right-clicking nodes + local new_stack = mcl_util.call_on_rightclick(itemstack, player, {type = "node", under = pos}) + if new_stack and new_stack ~= itemstack then return end if not def._mcl_waxed_variant then return end node.name = def._mcl_waxed_variant