Large requests sometimes get confused
dhouck opened this issue ยท 7 comments
Prerequisites
- I am running the latest alpha version of MineColonies and Structurize for my Minecraft version.
- I checked the MineColonies/Structurize wiki and made sure my issue is not covered there.
- I made sure that this issue is not a duplicate of any existing issue.
Context
- Minecraft Version: 1.16.5
- MineColonies Version: 0.14.182
- Structurize Version: 0.13.174
- Related Mods and their Versions:
Expected behavior
When there is a large request which requires multiple courier trips, the courier or couriers will deliver all the requested items in multiple trips, and not require more items.
Actual behavior
Sometimes (not reliably, unfortunately), a courier will deliver some of the items and then get confused and think they again need to deliver all of them, requiring more than the original number of items exist in the warehouse.
As I'm writing this I thought of a potential way to reliably reproduce; I'll make a comment if that pans out.
Steps to reproduce the issue
- Have a citizen make a request that requires more than one trip (eg. request 100 emerald blocks at the postbox, which requires the mechanic to request a bit over 14 stacks of emeralds) and most of the items in the warehouse (this part isn't necessary, probably, but makes it easier to observe)
- ??? (maybe unload something, maybe have the courier sleep, maybe some other request for the same item goes through; I'm not sure what's up)
- See that a large number of the requested item are delivered, but the courier wants more because they want to deliver the original amount again.
Logs
None; request system details don't show up in logs. If there's a debug option which changes that I'd be happy to try to gather logs but because this isn't reproducible on demand I might not succeed.
Notes
This might be related to #7185 in a couple ways:
- maybe "items from hut inventory" and "items from warehouse" are considered different paths
- This might be related to the clipboard request in the scenario there being for 18 instead of 9 emeralds
Viewers
- Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
- Add a comment if you have any insights or background information that isn't already part of the conversation.
My attempted reproduction worked. I gave 4 stacks of emeralds to the mechanic and 5 to the warehouse and a stack of emerald blocks, and I see a request for 576 emeralds on the clipboard.
Cancelling that clipboard request doesn't work, and neither does /mc colony requestsystem-reset 1
, although for one of the naturally-occurring instances of this issue I think the latter did.
I noticed this problem sometimes when two couriers should pickup items from a crafter. When the request contains 400 items, the two couriers divide their requests, and one of them picks up 3 stacks, and the other one 3 stacks plus 16.
When the second courier is first at the crafter, and takes the 3 stacks + 16 items, he leaves an incomplete stack of 48 items. The other courier gets confused about the stack of 48 items, and 16 items in another stack. He successfully picks up the other 2 stacks of 64, but won't pickup the 64 items in those two incomplete stacks.
Huh, that's probably part of it, but given the reproduction I had above, it can't be all of it.