From f10827d0d63402774a36244690a0e9309736fa72 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Wed, 28 Aug 2024 18:08:43 -0500 Subject: [PATCH] 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")