-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/same network multiple extract only storage buses #612
base: master
Are you sure you want to change the base?
Fix/same network multiple extract only storage buses #612
Conversation
…the same network will only have one of them work
… without filter reading from the same network
Drafted until I fix the issue with items in cyclic storage bus setups being attributed to the wrong network. |
Created a new issue for GTNewHorizons/GT-New-Horizons-Modpack#18074. Currently I cannot see a solution for it without large changes to AE2. The cause for both issues is the same, that the network is only read once. This PR however will still fix the issue of having multiple storage buses in extract-only reading from the same network and as such I reopened it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I'm not super confident in these changes, though testing will have to prove that. I left just one comment for now
if (!networkInventoryItems.containsKey(networkInventoryHandler)) { | ||
IItemList<T> allAvailableItems = this.getInternal() | ||
.getAvailableItems((IItemList<T>) this.getInternal().getChannel().createList(), iteration); | ||
networkInventoryItems.put(networkInventoryHandler, allAvailableItems); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this cache getting invalidated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every time the iteration number changes the cache is replaced with a new one
Closes GTNewHorizons/GT-New-Horizons-Modpack#17950
The available items in a network connected via a extract-only storage bus are only read once, a second attempt via another storage bus attempt will return early without checking the items since the network was already visited before.
This PR will make it so that the
StorageBusInventoryHandler
caches the items for the current iteration and from which network(s) it retrieved them.