Couriers can't handle split stacks at crafters
MotionlessTrain opened this issue ยท 0 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.268-ALPHA
- Structurize Version: 0.13.198-ALPHA
- Related Mods and their Versions:
Expected behavior
If a crafter crafts a large number of items (in my case it was 334 stone), the couriers should bring all them to the next destination (in my case the stone mason).
Actual behavior
The level 3 couriers needed to split the requests (only being able to handle 4 stacks at a time). One courier had to bring 4 stacks and another courier had to send the remaining 1 stack and 14 items.
This second courier happened to get first at the stone smelter, leaving behind a stack of 50 items, 3 full stacks and the remaining 14 items. The first courier came over, and only was able to bring those 3 full stacks to the stone mason. The last 64 items (in stacks of 50 items and 14 items respectively) were still present at the stone smelter.
As the courier had failed to do the delivery, the request system rerequested 334 cobblestone to send to the smelter.
The problem is that the courier is not able to see those two partial stacks as being a full stack together.
Steps to reproduce the issue
With some manual effort it is quite easy to reproduce the issue of the two partial stacks.
- Make sure the carpenter knows the oak planks recipe and there is a stack of oak logs in the warehouse (and no oak planks).
- Request (e.g. at the postbox) a stack of oak planks.
- Go to the carpenter. After they are done crafting, split the stack into two halves.
- A courier will come over, notice the full stack of oak planks is missing, making the request system rerequest the planks, and a courier bing over oak logs again.
Logs
I don't think anything of this behaviour ends up in logs, but here it is anyway
- latest.log: https://gist.github.com/MotionlessTrain/31e417809566a7232c4ff35cabcae367
- crashlog: N/A
Notes
I hijacked another issue earlier (#7159), but it is nicer to actually make a new one, as the issue is less related than I initially thought.
I tried to look at the code where it could go wrong. It looks like the gatherIfInTileEntity
method in EntityAIWorkDeliveryman only searches for one stack with an amount greater than or equal to the number of items in the delivery request. I suppose that is the culprit.
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.