1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2025-07-10 04:00:27 +02:00

Merge branch 'master' of yunohost:mtcontrib/minetest-3d_armor into dev

This commit is contained in:
2019-10-12 14:35:06 +02:00
16 changed files with 204 additions and 28 deletions

View File

@ -75,8 +75,11 @@ local function update_entity(pos)
local def = stack:get_definition() or {}
local groups = def.groups or {}
if groups["armor_"..element] then
local texture = def.texture or item:gsub("%:", "_")
table.insert(textures, texture..".png")
if def.texture then
table.insert(textures, def.texture)
else
table.insert(textures, item:gsub("%:", "_")..".png")
end
end
end
end
@ -304,7 +307,7 @@ minetest.register_entity("3d_armor_stand:armor_entity", {
pos = nil,
timer = 0,
on_activate = function(self)
local pos = self.object:getpos()
local pos = self.object:get_pos()
if pos then
self.pos = vector.round(pos)
update_entity(pos)