From c943cd7d4a1fba57f77072df5eebd9b467631bce Mon Sep 17 00:00:00 2001 From: OgelGames Date: Tue, 9 Feb 2021 20:22:50 +1100 Subject: [PATCH] remove display entity after digging --- protector.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/protector.lua b/protector.lua index 354adf5..d8ce318 100644 --- a/protector.lua +++ b/protector.lua @@ -70,6 +70,16 @@ minetest.register_node("priv_protector:protector", { local name = player:get_player_name() return name == meta:get_string("owner") or minetest.check_player_privs(name, {protection_bypass=true}) + end, + + after_destruct = function(pos) + local objects = minetest.get_objects_inside_radius(pos, 0.5) + for _, v in ipairs(objects) do + local ent = v:get_luaentity() + if ent and ent.name == "protector:display" then + v:remove() + end + end end })