Closed Bjonnfesk closed 1 year ago
We now first sort the items alphabetically, then keep adding them one by one on a sorted list. Single-word items are added regardless, while multi-word items are first compared against the addedItems list. The first multi-word item should be added regardless as well, then a loop checks for other items in the list with matching last words and adds them to both the sortedList and addedItems list. This ensures that items with matching last words are added together, but not readded to the list. Only time will tell if this sorting method is nice to use.
I conjecture that if we sort the items alphabetically before grouping them, the resulting list will be closer to being in alphabetical order.
https://github.com/Koulis2000/MCScripts/blob/f682a08bf2f0c039b9f13d492a0bfd3304e13dcc/CCTweaked/janus-dossier.lua#L148-L169