Close formspecs when double chest breaks

This commit is contained in:
Wuzzy 2019-03-09 05:51:58 +01:00
parent 79a3eb23a7
commit c6efa8a626

@ -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)