Bug: Crafter Manager incorrectly displays patterns from a Multiblock Crafter
calloatti opened this issue ยท 8 comments
Issue description:
When having a Multiblock Crafter from Reborn Storage, the Crafter Manager incorrectly displays the patterns contained in the Multiblock Crafter.
What happens:
There is a six page Multiblock Crafter from Reborn Storage in the network, Page 1 and Page 2 are full of patterns, Page 3 is partially full. (EDIT: has 20 empty slots at the end)
The Crafter Manager displays empty slots first for the empty pages (4,5,6), then displays Page 2 and 3, and finally Page 1.
What you expected to happen:
Patterns displayed in order.
Version (make sure you are on the latest version before reporting):
RebornCore-1.12.2-3.8.0.264-universal
RebornStorage-1.12.2-3.0.6.43
refinedstorage-1.5.33
refinedstorageaddons-0.3
Forge Mod Loader version 14.23.2.2650
MC 1.12.2
I don't know how the paging works in Reborn Storage, but RS doesn't have any sort of ordering of containers.
RebornStorage stores each of the pages in their respective blocks. So they will be loaded in a "random" order by RS. We store the page number on the tile, and then sort them before opening the gui. I dont see an easy way for either us to fix this. Unless there is some way to sort the order of the inv's in the grid (code wise).
Im not sure if it is worth the effort to fix tbh. I would be happy to try and work something out however.
How would you sort from your code? Do you store which blocks are placed first?
I could change RS to sort based on block position, but I'm not sure if that's effective.
All of our tiles have the page + the last page that was open: https://github.com/TechReborn/RebornStorage/blob/1.12/src/main/java/me/modmuss50/rebornstorage/tiles/TileMultiCrafter.java#L100-L101
the pages are initially built from the list of connectedParts from the multiblock, so they are in no way deterministic.
So, technically, if I provide a "int getIndex()" function, sorting would work?
yeah, that should actually work. Im not sure how well it would handle with more than 2 multiblocks, however, but I think most people will just have 1 multiblock.
Hrm yeah, if it doesn't work with 2 multiblocks, it's a bad solution. Some more thinking will have to be done.
Kinda fixed with 5ca5160
The crafter manager order is now deterministic (sorted on position), but it will appear unsorted in the actual Reborn Storage inventory.
But this is good enough.