From c6efa8a6262fa4a568cb4ced8a12ca69011dc6df Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 9 Mar 2019 05:51:58 +0100 Subject: [PATCH] Close formspecs when double chest breaks --- mods/ITEMS/mcl_chests/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 9f0ebd45b6..e17450aedf 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -220,6 +220,9 @@ minetest.register_node("mcl_chests:"..basename.."_left", { if not p or minetest.get_node(p).name ~= "mcl_chests:"..basename.."_right" then return end + for pl=1, #players do + minetest.close_formspec(players[pl]:get_player_name(), "mcl_chests:"..formspec_basename.."_"..p.x.."_"..p.y.."_"..p.z) + end minetest.swap_node(p, { name = "mcl_chests:"..basename, param2 = param2 }) end, after_dig_node = function(pos, oldnode, oldmetadata, digger) @@ -341,6 +344,9 @@ minetest.register_node("mcl_chests:"..basename.."_right", { if not p or minetest.get_node(p).name ~= "mcl_chests:"..basename.."_left" then return end + for pl=1, #players do + minetest.close_formspec(players[pl]:get_player_name(), "mcl_chests:"..formspec_basename.."_"..p.x.."_"..p.y.."_"..p.z) + end minetest.swap_node(p, { name = "mcl_chests:"..basename, param2 = param2 }) end, after_dig_node = function(pos, oldnode, oldmetadata, digger)