Module:Inventory slot/Aliases: Difference between revisions

No edit summary
fix damaged weapons and tools not having the proper tooltip (attack damage description)
Line 237: Line 237:
for _, toolProps in ipairs( tools ) do
for _, toolProps in ipairs( tools ) do
local aliasName = toolProps[1] .. ' ' .. toolProps[2]
local aliasName = toolProps[1] .. ' ' .. toolProps[2]
aliases[aliasName] = { title = aliasName, name = aliasName, text = '/&7When in main hand:/ &2' .. toolProps[3] .. ' Attack Speed/ &2' .. toolProps[4] .. ' Attack Damage' }
local damagedName = 'Damaged ' .. aliasName
local text = '/&7When in main hand:/ &2' .. toolProps[3] .. ' Attack Speed/ &2' .. toolProps[4] .. ' Attack Damage'
aliases[aliasName] = { title = aliasName, name = aliasName, text = text }
-- add damaged here as well so it gets the proper tooltip
aliases[damagedName] = { title = aliasName, name = damagedName, text = text }
local materialGroup = toolProps[1]:lower();
local materialGroup = toolProps[1]:lower();
Line 444: Line 448:
end
end


-- Damaged armor, tools and weapons --
-- Damaged armor, note it skips tools and weapons as they are handled above to add the damage tooltip --
local damagedItems = {
local damagedItems = {
'Bow',
'Bow',
Line 453: Line 457:
'Chainmail Leggings',
'Chainmail Leggings',
'Crossbow',
'Crossbow',
'Diamond Axe',
'Diamond Boots',
'Diamond Boots',
'Diamond Chestplate',
'Diamond Chestplate',
'Diamond Helmet',
'Diamond Helmet',
'Diamond Hoe',
'Diamond Leggings',
'Diamond Leggings',
'Diamond Pickaxe',
'Diamond Shovel',
'Diamond Sword',
'Elytra',
'Elytra',
'Fishing Rod',
'Fishing Rod',
'Flint and Steel',
'Flint and Steel',
'Golden Axe',
'Golden Boots',
'Golden Boots',
'Golden Chestplate',
'Golden Chestplate',
'Golden Helmet',
'Golden Helmet',
'Golden Hoe',
'Golden Leggings',
'Golden Leggings',
'Golden Pickaxe',
'Golden Shovel',
'Golden Sword',
'Iron Axe',
'Iron Boots',
'Iron Boots',
'Iron Chestplate',
'Iron Chestplate',
'Iron Helmet',
'Iron Helmet',
'Iron Hoe',
'Iron Leggings',
'Iron Leggings',
'Iron Pickaxe',
'Iron Shovel',
'Iron Sword',
'Leather Boots',
'Leather Boots',
'Leather Tunic',
'Leather Tunic',
'Leather Cap',
'Leather Cap',
'Leather Pants',
'Leather Pants',
'Netherite Axe',
'Netherite Boots',
'Netherite Boots',
'Netherite Chestplate',
'Netherite Chestplate',
'Netherite Helmet',
'Netherite Helmet',
'Netherite Hoe',
'Netherite Leggings',
'Netherite Leggings',
'Netherite Pickaxe',
'Netherite Shovel',
'Netherite Sword',
'Shears',
'Shears',
'Shield',
'Shield'
'Stone Axe',
'Stone Hoe',
'Stone Pickaxe',
'Stone Shovel',
'Stone Sword',
'Wooden Axe',
'Wooden Hoe',
'Wooden Pickaxe',
'Wooden Shovel',
'Wooden Sword'
}
}
for _, item in ipairs( damagedItems ) do
for _, item in ipairs( damagedItems ) do