Module:Inventory slot/Aliases: Difference between revisions
Remove old stained clay alias, update banner aliases |
Automatized tools and swords |
||
| Line 5: | Line 5: | ||
} | } | ||
local aliases = { | local aliases = { | ||
-- Common fuel types for furnace -- | -- Common fuel types for furnace -- | ||
['Any fuel'] = { 'Coal', 'Charcoal', { title = 'Wood', name = 'Oak Wood' }, { title = 'Wood Planks', name = 'Oak Wood Planks' }, 'Block of Coal' }, | ['Any fuel'] = { 'Coal', 'Charcoal', { title = 'Wood', name = 'Oak Wood' }, { title = 'Wood Planks', name = 'Oak Wood Planks' }, 'Block of Coal' }, | ||
['Any leather armor'] = { 'Leather Cap', 'Leather Tunic', 'Leather Pants', 'Leather Boots' }, | ['Any leather armor'] = { 'Leather Cap', 'Leather Tunic', 'Leather Pants', 'Leather Boots' }, | ||
['Any golden armor'] = { 'Golden Helmet', 'Golden Chestplate', 'Golden Leggings', 'Golden Boots' }, | ['Any golden armor'] = { 'Golden Helmet', 'Golden Chestplate', 'Golden Leggings', 'Golden Boots' }, | ||
| Line 89: | Line 68: | ||
['Arrow of Decay'] = { name = 'Arrow of Decay', text = '&cWither II (0:05)' }, | ['Arrow of Decay'] = { name = 'Arrow of Decay', text = '&cWither II (0:05)' }, | ||
} | } | ||
-- Tools and weapons -- | |||
local tools = { | |||
{'Wooden', 'Sword', 1.6, 4 }, | |||
{'Stone', 'Sword', 1.6, 5 }, | |||
{'Iron', 'Sword', 1.6, 4 }, | |||
{'Golden', 'Sword', 1.6, 7 }, | |||
{'Diamond', 'Sword', 1.6, 6 }, | |||
{'Wooden', 'Pickaxe', 1.2, 2 }, | |||
{'Stone', 'Pickaxe', 1.2, 3 }, | |||
{'Iron', 'Pickaxe', 1.2, 4 }, | |||
{'Golden', 'Pickaxe', 1.2, 2 }, | |||
{'Diamond', 'Pickaxe', 1.2, 5 }, | |||
{'Wooden', 'Axe', 0.8, 7 }, | |||
{'Stone', 'Axe', 0.8, 9 }, | |||
{'Iron', 'Axe', 0.9, 9 }, | |||
{'Golden', 'Axe', 1, 7 }, | |||
{'Diamond', 'Axe', 1, 9 }, | |||
{'Wooden', 'Shovel', 1, 2.5 }, | |||
{'Stone', 'Shovel', 1, 3.5 }, | |||
{'Iron', 'Shovel', 1, 4.5 }, | |||
{'Golden', 'Shovel', 1, 2.5 }, | |||
{'Diamond', 'Shovel', 1, 5.5 }, | |||
{'Wooden', 'Hoe', 1, 1 }, | |||
{'Stone', 'Hoe', 2, 1 }, | |||
{'Iron', 'Hoe', 3, 1 }, | |||
{'Golden', 'Hoe', 1, 1 }, | |||
{'Diamond', 'Hoe', 4, 1 } | |||
} | |||
local materialGroups = {} | |||
local toolGroups = {} | |||
for _, toolProps in ipairs( tools ) do | |||
local aliasName = toolProps[1] .. ' ' .. toolProps[2] | |||
aliases[aliasName] = { title = aliasName, name = aliasName, text = '/&7When in main hand:/ &7' .. toolProps[3] .. ' Attack Speed/ &7' .. toolProps[4] .. ' Attack Damage' } | |||
local materialGroup = toolProps[1]:lower(); | |||
local toolGroup = toolProps[2]:lower(); | |||
if toolProps[2] ~= 'Sword' then | |||
if materialGroups[materialGroup] == nil then materialGroups[materialGroup] = {} end | |||
table.insert( materialGroups[materialGroup], aliases[aliasName] ) | |||
end | |||
if toolGroups[toolGroup] == nil then toolGroups[toolGroup] = {} end | |||
table.insert( toolGroups[toolGroup], aliases[aliasName] ) | |||
end | |||
for materialGroup, items in pairs( materialGroups ) do | |||
aliases['Any ' .. materialGroup .. ' tools'] = items | |||
end | |||
for toolGroup, items in pairs( toolGroups ) do | |||
aliases['Any ' .. toolGroup] = items | |||
end | |||
-- Lists of item variants -- | -- Lists of item variants -- | ||