Skip to content

Commit

Permalink
remove display entity after digging
Browse files Browse the repository at this point in the history
  • Loading branch information
OgelGames committed Feb 9, 2021
1 parent 43aabd4 commit c943cd7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions protector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
})

Expand Down

0 comments on commit c943cd7

Please sign in to comment.