mirror of
https://github.com/pyrollo/display_modpack.git
synced 2025-02-10 23:30:21 +01:00
don't let explosions destroy sign entities
This commit is contained in:
parent
e0e0305836
commit
4d483563f6
@ -81,9 +81,16 @@ end
|
||||
-- Detect rotation restriction
|
||||
local rotation_restricted = nil
|
||||
minetest.register_entity('display_api:dummy_entity', {
|
||||
collisionbox = { 0, 0, 0, 0, 0, 0 },
|
||||
initial_properties = {
|
||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
||||
visual = "upright_sprite",
|
||||
textures = {} })
|
||||
is_visible = false,
|
||||
textures = {"blank.png"}
|
||||
},
|
||||
on_blast = function(self, damage)
|
||||
return false, false, {}
|
||||
end,
|
||||
})
|
||||
|
||||
function display_api.is_rotation_restricted()
|
||||
if rotation_restricted == nil then
|
||||
@ -304,13 +311,18 @@ end
|
||||
function display_api.register_display_entity(entity_name)
|
||||
if not minetest.registered_entities[entity_name] then
|
||||
minetest.register_entity(':'..entity_name, {
|
||||
collisionbox = { 0, 0, 0, 0, 0, 0 },
|
||||
initial_properties = {
|
||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
||||
visual = "upright_sprite",
|
||||
textures = {},
|
||||
},
|
||||
on_activate = display_api.on_activate,
|
||||
get_staticdata = function(self)
|
||||
return minetest.serialize({ nodepos = self.nodepos })
|
||||
end,
|
||||
on_blast = function(self, damage)
|
||||
return false, false, {}
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
@ -61,9 +61,11 @@ minetest.register_lbm({ name = "signs:conpatibility_1",
|
||||
-- We need to have this entity registered to be able to remove it.
|
||||
if minetest.registered_entities["signs:text"] == nil then
|
||||
minetest.register_entity("signs:text", {
|
||||
collisionbox = { 0, 0, 0, 0, 0, 0 },
|
||||
visual = "upright_sprite",
|
||||
textures = {},
|
||||
on_activate = function(self)
|
||||
if self.object then
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user