Skip to content
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

Items disappearing when transferred from furnace output to full inventory #122

Open
Cra7y opened this issue Aug 7, 2022 · 2 comments
Open
Labels
bug Something isn't working

Comments

@Cra7y
Copy link

Cra7y commented Aug 7, 2022

Minecraft Version

1.18.x

Version

1.100.8

Details

I have a system that transfers items from a furnace output slot to a barrel. When the barrel is full items will disappear instead of staying in the furnace.
The issue is not specific to barrels, it also happens with chests

Steps to recreate:

  1. Create at wired network containing a furnace, a computer and a barrel
    2022-08-07_11 54 54
  2. Block the barrel with an item
    image
  3. Smelt some items in the furnace
    image
  4. Run this program:
barrel = peripheral.find("minecraft:barrel")
furnace = peripheral.find("minecraft:furnace")
print(furnace.pushItems(peripheral.getName(barrel), 3))
  1. All the items from the output slot will disappear

Other observations:
If there is some but not enough space in the target inventory it will fill the inventory and the remaining items will disappear.
The pushItems function returns the amount of items successfully moved, the disappeared items are not counted.
If a limit is set in the pushItems function only the amount of items specified will disappear.

@Cra7y Cra7y added the bug Something isn't working label Aug 7, 2022
@Merith-TK
Copy link
Collaborator

can you send logs of this in singleplayer?

launch MC
make singleplayer world
re-create bug
close mc
upload latest.log to https://mclo.gs

but yeah, that is most definately NOT intended behaviour

@Cra7y
Copy link
Author

Cra7y commented Aug 8, 2022

Yes, i will do that and link it here.
It may take a day or two before i get around to it.

toad-dev added a commit to toad-dev/cc-restitched that referenced this issue Sep 5, 2022
This was happening because the output slot of a furnace is protected
from all insertions. We were greedily extracting items at the beginning
of the transfer and couldn't place the remainder back into the protected
slot. Instead, simulate the transaction first, count how many items
successfully transfer, then actually mutate the inventories by that
amount. The ItemStorage wrappers already supported simulating
transactions, so I just exposed the option in InventoryUtil.

Also, because it's likely there's still some edge cases where things
will go wrong (especially in the presence of modded blocks), I added
some detailed logging in the case that we detect that items have been
lost.

Fixes cc-tweaked#122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants