From 9c83755f533c76270428ece04ee9941f1db0614d Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Wed, 29 Mar 2023 17:28:13 -0600 Subject: [PATCH] Make banners drop when support node is dug and when banner node is dug --- mods/ITEMS/mcl_banners/init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mods/ITEMS/mcl_banners/init.lua b/mods/ITEMS/mcl_banners/init.lua index cc0e02e66..f50488b35 100644 --- a/mods/ITEMS/mcl_banners/init.lua +++ b/mods/ITEMS/mcl_banners/init.lua @@ -113,14 +113,6 @@ local function on_dig_banner(pos, node, digger) minetest.record_protection_violation(pos, name) return end - -- Drop item - local meta = minetest.get_meta(pos) - local item = meta:get_inventory():get_stack("banner", 1) - if not item:is_empty() then - minetest.handle_node_drops(pos, {item:to_string()}, digger) - else - minetest.handle_node_drops(pos, {"mcl_banners:banner_item_white"}, digger) - end -- Remove node minetest.remove_node(pos) end @@ -141,6 +133,14 @@ local function on_destruct_banner(pos, hanging) local ent = v:get_luaentity() if ent and ent.name == nodename then v:remove() + -- Drop item + local meta = minetest.get_meta(pos) + local item = meta:get_inventory():get_stack("banner", 1) + if not item:is_empty() then + minetest.handle_node_drops(pos, {item:to_string()}, digger) + else + minetest.handle_node_drops(pos, {"mcl_banners:banner_item_white"}, digger) + end end end end