From 5675a518efe2cf663a7f98b015e2f95112efdd05 Mon Sep 17 00:00:00 2001 From: jp Date: Thu, 26 Nov 2015 16:36:02 +0100 Subject: [PATCH] Mailbox : drop unecessary conditions --- mailbox.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mailbox.lua b/mailbox.lua index dd356ff..c8d60e4 100644 --- a/mailbox.lua +++ b/mailbox.lua @@ -70,15 +70,11 @@ xdecor.register("mailbox", { local function img_col(stack) if not stack then return "" end - if stack.type == "node" then - if stack.inventory_image ~= "" then - return stack.inventory_image:match("([%w_]+)%.png")..".png" - else - return stack.tiles[1]:match("([%w_]+)%.png")..".png" - end - elseif stack.type == "tool" or stack.type == "craft" then + if stack.inventory_image ~= "" then return stack.inventory_image:match("([%w_]+)%.png")..".png" - else return "" end + else + return stack.tiles[1]:match("([%w_]+)%.png")..".png" + end end function mailbox.formspec(pos, owner, num)