-
-
Notifications
You must be signed in to change notification settings - Fork 367
Prevent the cookery from keeping all empty bottles #10367
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
base: version/main
Are you sure you want to change the base?
Conversation
# Conflicts: # src/main/java/com/minecolonies/core/entity/ai/workers/service/EntityAIWorkDeliveryman.java
* The itemstack to filter for this specific pickup. | ||
*/ | ||
@Nullable | ||
private List<ItemStack> pickupFilter; |
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.
We should just initiate this with an empty list to simplify the rest of the logic.
{ | ||
super(priority); | ||
if (filter != null) | ||
{ | ||
this.pickupFilter = filter.stream().map(ItemStack::copy).collect(Collectors.toList()); |
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.
we can just use empty list instead and then avoid the nullable. Why do we need a deep copy?
@@ -464,6 +464,11 @@ protected IAIState craft() | |||
module.improveRecipe(currentRecipeStorage, job.getCraftCounter(), worker.getCitizenData()); | |||
} | |||
|
|||
if (!currentRecipeStorage.getSecondaryOutputs().isEmpty()) | |||
{ | |||
building.createPickupRequest(10, currentRecipeStorage.getSecondaryOutputs()); |
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.
This indicates that it's not a pickup filter, but instead it's sort of a specific pickup request".
final ItemStack activeStack = handler.extractItem(currentSlot, filter.getCount(), false); | ||
transferItemForPickup(activeStack); | ||
if (filter.getCount() == activeStack.getCount()) | ||
{ |
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.
Feels weird to be iterator based. Can't we just make this a if pickupList.contains(new ItemStorage(stackInCurrentSlot)?
Closes #10360
Changes proposed in this pull request
This way crafters can tell couriers to pick up all secondary outputs of the crafter.
Testing
Review please