[enhancement] sort by mod/id
shadoxxhd opened this issue ยท 3 comments
add a button to toggle between standard mode (sorting rules), sort-by-id, sort-by-source-mod-then-by-id (in the case a mod uses seperated id spaces), sort-by-name, sort-by-oreDict-then-by-id and sort-by-class-name
why?
it often happens to me that invtw sorts items strangely, for example like that:
someitem:0, someitem:1, someitem:3, someitem:4, item2, item3, item4, someitem:2, item5
so except for the obvious utility, it would also fix some annoyances which are probably because of inconsistent priority comparison
other enhancements:
-config option to disable sort modes (both sort order and default/rows/columns)
-custom (lua?) comparator function (so you can write your own logic for sorting) (how you could do it: if i remember correctly, there was a sorting function which takes the java equivalent of a function pointer (a class containing the function to call, bool comp( elem1, elem2);). so you just have to let this function pass the arguments to the script interpreter and return the result)
EDIT: that's what i was talking of: http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html
I'm not really interested in embedding a full on script for sorting. You can already control it by the order items appear in the item tree file, anyway.
The default sorting after that is implemented here, which, after checking the tree overrides, does full id ("minecraft:[name]" for vanilla, typically "[modid]:[name]" for mods), followed by perferencing anvil-named items, then enchanted items (by # of enchants, id of enchants, then level of enchants), then damage/meta value
Until somewhat recently there was a bit of a weirdness with how it assigned base priority to certain items, which caused a strange sort.