Module:Skills/Gathering: Difference between revisions

getTreesTable: Sort rows by level requirement
(getRecipeRequirements: Support 'requirements' property of recipes. Also replaces the 'shopItemPurchased' property)
(getTreesTable: Sort rows by level requirement)
Line 37: Line 37:
table.insert(resultPart, '!!XP!!Cut Time!!XP/s!!GP/s')
table.insert(resultPart, '!!XP!!Cut Time!!XP/s!!GP/s')


for i, tree in ipairs(SkillData.Woodcutting.trees) do
local trees = Shared.shallowClone(SkillData.Woodcutting.trees)
table.sort(trees, function(a, b) return a.level < b.level end)
for i, tree in ipairs(trees) do
local log = Items.getItemByID(tree.productId)
local log = Items.getItemByID(tree.productId)
table.insert(resultPart, '\n|-')
table.insert(resultPart, '\n|-')