Mailbox : drop unecessary conditions
This commit is contained in:
parent
cc829021fc
commit
5675a518ef
12
mailbox.lua
12
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)
|
||||
|
Loading…
Reference in New Issue
Block a user