Place a hopper and fill every slot with 1 stackable item (eg: stone). In this configuration, the hopper cannot accept any new items.
Place a composter on top. Fill the composter up (eg: with pumpkin pie).
Expected result:
The filled composter turns into bone meal that cannot be pulled by the hopper and thus should stay in the composter.
Actual result:
The bonemeal gets deleted by the hopper.
Checking the code and the fix seems simple : This occurs because the hopper first removes the item from the container, tries to insert it in any of his slots, and insert the remainder back into the original container (HopperBlockEntity.tryTakeInItemFromSlot()).
While this logic works for any other container, it doesnβt work with ComposterBlock.OutputContainer because when the hopper puts back the remaining ItemStack into the container via SimpleContainer.setItem(), and setItem() calls this.setChanged() which ComposterBlock.OutputContainer overrides to unconditionally call ComposterBlock.empty() β deleting the bonemeal.
The fix is quite simple, and would simply require wrapping the logic in ComposterBlock.OutputContainer.setChanged() with a if (this.isEmpty()) :
@Override
public void setChanged() {
if (this.isEmpty()) {
ComposterBlock.empty(null, this.state, this.level, this.pos);
this.changed = true;
}
}
Thank you for your report!
We're tracking this issue in MC-175090, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support (Technical Issues) β π§ Microsoft Support (Account Issues)
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki