BuckarooBanzay 3e95d5830e init
2023-06-20 14:48:30 +02:00

33 lines
689 B
Lua

-- id -> true
local active_entities = {}
minetest.register_entity("pick_and_place:display", {
initial_properties = {
physical = false,
static_save = false,
collisionbox = {0, 0, 0, 0, 0, 0},
visual = "upright_sprite",
visual_size = {x=10, y=10},
glow = 10
},
on_step = function(self)
if not active_entities[self.id] then
-- not valid anymore
self.object:remove()
end
end
})
function pick_and_place.add_entity(pos, id)
active_entities[id] = true
local ent = minetest.add_entity(pos, "pick_and_place:display")
local luaent = ent:get_luaentity()
luaent.id = id
return ent
end
function pick_and_place.remove_entities(id)
active_entities[id] = nil
end