Module:Inventory slot/Aliases: Difference between revisions
No edit summary |
m getting rusty these days |
||
| Line 384: | Line 384: | ||
['Matching Waxed (Weathered) Cut Copper'] = {'Waxed Cut Copper', 'Waxed Lightly Weathered Cut Copper', 'Waxed Semi-Weathered Cut Copper'}, | ['Matching Waxed (Weathered) Cut Copper'] = {'Waxed Cut Copper', 'Waxed Lightly Weathered Cut Copper', 'Waxed Semi-Weathered Cut Copper'}, | ||
} | } | ||
function map(tbl, f) | |||
local t = {} | |||
for k,v in pairs(tbl) do | |||
t[k] = f(v) | |||
end | |||
return t | |||
end | |||
for k, v in pairs(copperstuff) do | for k, v in pairs(copperstuff) do | ||
aliases[k] = v | aliases[k] = v | ||
local k1 = k:gsub(' Block$') | local k1 = k:gsub(' Block$', '') | ||
local v1 = v:gsub(' Block$') | local v1 = map(v, function(s) return s:gsub(' Block$', '') end) | ||
aliases[k1 .. 'Slab'] = v1 .. 'Slab' | aliases[k1 .. 'Slab'] = map(v1, function(s) return s .. 'Slab' end) | ||
aliases[k1 .. 'Stairs'] = v1 .. 'Stairs' | aliases[k1 .. 'Stairs'] = map(v1, function(s) return s .. 'Stairs' end) | ||
end | end | ||