
Storage Sort Functionality Item Overwriting
Closed this issue ยท 5 comments
There is an edge case with storage sorting that causes items with the same meta-name that aren't stackable to overwrite each other during the sort function.
This is likely a mod-only issue, as I am unaware of any vanilla items which have differing sub-data but share a meta-name. However, some mods utilize items that have fairly important data outside the meta name, primarily Cobblemon Pokemon eggs, which ends up for a fairly game-breaking bug.
Essentially, it seems like the sort function, rather than doing a direct placement, does a shallow copy, utilizing the first item and cloning it to the locations after.
I plan on personally digging into this, so as not to pull resources from other enhancements or bugs, but wanted to make a ticket for visibility.
That's not how sophisticated sort works - it takes their unique keys, sorts by these and then puts them in slots 1 by 1. so if eggs are getting merged that would mean they would need to have the same id and that would also mean that simply piping them in / pickup or magnet upgrade inserting them / clicking them in through controller would do the same.
Are you sure that you're using sophisticated sorting and not some other mod to sort the storage?
That's not how sophisticated sort works - it takes their unique keys, sorts by these and then puts them in slots 1 by 1. so if eggs are getting merged that would mean they would need to have the same id and that would also mean that simply piping them in / pickup or magnet upgrade inserting them / clicking them in through controller would do the same. Are you sure that you're using sophisticated sorting and not some other mod to sort the storage?
It looks like we're using the Unofficial Fabric port, but no other sorting mods or storage mods. I'll take a look at both and see if there's something either in the Fabric porting or otherwise, but I'm also wondering if Cobblemon was lazy with the eggs and found a way to make all eggs of a certain base type share a unique ID, and have somehow edited other data elsewhere, but that still wouldn't make sense as to why it's happening in the circumstances it does.
Let me take a screen recording of the replication method that I have and share it so you can also see what's going on and maybe give me a point in a direction to start digging. (I'm a Sr Engineer by day job, we just don't use GitHub so my history doesn't show that, and one of our largest systems is in Java, so I have no problems digging through code)
InventorySorter
class in sophisticatedcore
does the sorting, but you would also want to log this in Salandora's tracker for the unofficial port as this tracker is only for (neo)forge version.
https://youtu.be/3qiT3Ke0Ytk here is the screen cap of the bug in action, I will log it in Salandora's cloned repo as well. I did notice the InventorySorter
class and will take a dig and see what I can find. It's definitely an odd duck of a bug. And after digging through mods, I definitely don't see another sorter, and the key assignment is for Sophisticated, so time for some digging.
Edit: fixed video visibilty