From 40837822464d5510f8d494d311dcbb5afa2c3cf2 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Wed, 29 Mar 2017 19:18:49 +0100 Subject: [PATCH] Improve get_armor_formspec --- 3d_armor/api.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/3d_armor/api.lua b/3d_armor/api.lua index b52b065..f019eaf 100644 --- a/3d_armor/api.lua +++ b/3d_armor/api.lua @@ -288,15 +288,15 @@ armor.get_preview = function(self, name) end armor.get_armor_formspec = function(self, name, listring) - if not armor.def[name] or not armor.textures[name] then - return "" - end local formspec = armor.formspec.. "list[detached:"..name.."_armor;armor;0,0.5;2,3;]" if listring == true then formspec = formspec.."listring[current_player;main]".. "listring[detached:"..name.."_armor;armor]" end + if not armor.def[name] or not armor.textures[name] then + return formspec + end formspec = formspec:gsub("armor_preview", armor.textures[name].preview) formspec = formspec:gsub("armor_level", armor.def[name].level) for _, attr in pairs(self.attributes) do