mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2025-01-03 13:37:29 +01:00
Add initial_properties
to armor stand entity (#116)
* Add `initial_properties` to armor stand entity * Keep pos param * fix * fix crash
This commit is contained in:
parent
aef125a0ca
commit
c894ba4b0c
@ -300,26 +300,27 @@ minetest.register_node("3d_armor_stand:locked_armor_stand", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_entity("3d_armor_stand:armor_entity", {
|
minetest.register_entity("3d_armor_stand:armor_entity", {
|
||||||
physical = true,
|
initial_properties = {
|
||||||
visual = "mesh",
|
physical = true,
|
||||||
mesh = "3d_armor_entity.obj",
|
visual = "mesh",
|
||||||
visual_size = {x=1, y=1},
|
mesh = "3d_armor_entity.obj",
|
||||||
collisionbox = {0,0,0,0,0,0},
|
visual_size = {x=1, y=1},
|
||||||
textures = {"3d_armor_trans.png"},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
pos = nil,
|
textures = {"3d_armor_trans.png"},
|
||||||
timer = 0,
|
},
|
||||||
|
_pos = nil,
|
||||||
on_activate = function(self)
|
on_activate = function(self)
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
if pos then
|
if pos then
|
||||||
self.pos = vector.round(pos)
|
self._pos = vector.round(pos)
|
||||||
update_entity(pos)
|
update_entity(pos)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_blast = function(self, damage)
|
on_blast = function(self, damage)
|
||||||
local drops = {}
|
local drops = {}
|
||||||
local node = minetest.get_node(self.pos)
|
local node = minetest.get_node(self._pos)
|
||||||
if node.name == "3d_armor_stand:armor_stand" then
|
if node.name == "3d_armor_stand:armor_stand" then
|
||||||
drop_armor(self.pos)
|
drop_armor(self._pos)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
return false, false, drops
|
return false, false, drops
|
||||||
|
Loading…
Reference in New Issue
Block a user