added old entities removal

This commit is contained in:
Alexsandro Percy 2023-12-02 20:03:41 -03:00
parent b14dd24921
commit a8cbaf8687
6 changed files with 22 additions and 198 deletions

View File

@ -167,28 +167,6 @@ initial_properties = {
})
minetest.register_entity('automobiles_buggy:pivot_mesh',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "mesh",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_black.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_buggy:steering',{
initial_properties = {
physical = false,
@ -211,28 +189,6 @@ initial_properties = {
})
minetest.register_entity('automobiles_buggy:pointer',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "mesh",
mesh = "automobiles_pointer.b3d",
visual_size = {x = 0.8, y = 0.8, z = 0.8},
textures = {"automobiles_white.png"},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity("automobiles_buggy:buggy", {
initial_properties = {
physical = true,

View File

@ -166,50 +166,6 @@ initial_properties = {
})
minetest.register_entity('automobiles_catrelle:pivot_mesh',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "mesh",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_black.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_catrelle:pointer',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "mesh",
mesh = "automobiles_pointer.b3d",
visual_size = {x = 0.5, y = 0.5, z = 0.5},
textures = {"automobiles_white.png"},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity("automobiles_catrelle:catrelle", {
initial_properties = {
physical = true,

View File

@ -175,28 +175,6 @@ initial_properties = {
})
minetest.register_entity('automobiles_coupe:pivot_mesh',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "mesh",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_black.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_coupe:steering',{
initial_properties = {
physical = false,
@ -219,28 +197,6 @@ initial_properties = {
})
minetest.register_entity('automobiles_coupe:pointer',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "mesh",
mesh = "automobiles_pointer.b3d",
visual_size = {x = 0.5, y = 0.5, z = 0.5},
textures = {"automobiles_white.png"},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity("automobiles_coupe:coupe", {
initial_properties = {
physical = true,

View File

@ -306,50 +306,6 @@ initial_properties = {
})
minetest.register_entity('automobiles_delorean:pivot_mesh',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "mesh",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_black.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_delorean:pointer',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "mesh",
mesh = "automobiles_pointer.b3d",
visual_size = {x = 0.5, y = 0.5, z = 0.5},
textures = {"automobiles_white.png"},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity("automobiles_delorean:delorean", {
initial_properties = {
physical = true,

View File

@ -678,3 +678,25 @@ minetest.register_chatcommand("noobfy_the_vehicles", {
storage:set_int("noob_mode", save)
end,
})
local old_entities = {
"automobiles_buggy:pivot_mesh",
"automobiles_buggy:pointer",
"automobiles_catrelle:pivot_mesh",
"automobiles_catrelle:pointer",
"automobiles_coupe:pivot_mesh",
"automobiles_coupe:pointer",
"automobiles_delorean:pivot_mesh",
"automobiles_delorean:pointer",
"automobiles_roadster:pivot_mesh",
"automobiles_trans_am:pivot_mesh",
"automobiles_trans_am:pointer",
}
for _,entity_name in ipairs(old_entities) do
minetest.register_entity(":"..entity_name, {
on_activate = function(self, staticdata)
self.object:remove()
end,
})
end

View File

@ -143,28 +143,6 @@ initial_properties = {
})
minetest.register_entity('automobiles_roadster:pivot_mesh',{
initial_properties = {
physical = false,
collide_with_objects=false,
pointable=false,
visual = "mesh",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_black.png",},
},
on_activate = function(self,std)
self.sdata = minetest.deserialize(std) or {}
if self.sdata.remove then self.object:remove() end
end,
get_staticdata=function(self)
self.sdata.remove=true
return minetest.serialize(self.sdata)
end,
})
minetest.register_entity('automobiles_roadster:steering',{
initial_properties = {
physical = false,