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

Reject after filling inventory with stack splitting #19

Closed
S-S-X opened this issue Mar 18, 2022 · 4 comments
Closed

Reject after filling inventory with stack splitting #19

S-S-X opened this issue Mar 18, 2022 · 4 comments
Labels
question Further information is requested

Comments

@S-S-X
Copy link
Member

S-S-X commented Mar 18, 2022

Marked as a question because I'm not really sure if this should be handled here or in mods (which is possible already but complicates things a lot).

When feeding large stacks using tubes to inventories with stack splitting enabled it can (and most often will) cause stacks to get stuck between inventory and tube.

This seems to happen because it seems like inventory with stack splitting enabled will always accept stack but if inventory is actually full then it returns stack to originating tube.
Then inventories have higher priority and this can cause stack to be sent again back towards inventory which is full but accepts stacks because stack splitting is enabled.

Solving this without looking at inventory contents would be possible with stack splitting rate limiters, this can however cause missed stacks in some special cases.
Solving this by checking if returned stack was not splitted and in that case disallowing return or if other direction is not possible then dropping stack to ground would be more accurate option.

I've not tested much what actually affects this behavior but it seems that sending a lot of stacks will make some stacks bypass inventory.
Also not sure if this is actually issue only with some specific tube types but if it is then sorting tube would probably be good for testing.

@S-S-X S-S-X added the question Further information is requested label Mar 18, 2022
@OgelGames
Copy link
Contributor

This should be handled by the can_insert function of a pipeworks-compatible node, if it returns the correct value. (something I fixed recently with drawer controllers: minetest-mods/drawers#68)

The default if can_insert is not defined is to insert the stack:

if not tube_def or not tube_def.can_insert or
tube_def.can_insert(npos, node, stack, vect, owner) then

I'd say it should be fixed in the node definition, pipeworks already does what it should.

@SwissalpS
Copy link
Contributor

SwissalpS commented Jun 14, 2023

I'd say it should be fixed in the node definition, pipeworks already does what it should.

So we can close this? Or do we need it as reminder to check other mods and update them?

Edit: I recently had this happen with technic alloy

@S-S-X
Copy link
Member Author

S-S-X commented Jun 14, 2023

So we can close this? Or do we need it as reminder to check other mods and update them?

Should prob add issue to Technic repo and then close this one.

@S-S-X
Copy link
Member Author

S-S-X commented Jul 22, 2023

Closing this, can continue with implementation / discussion about technical details on linked issue mt-mods/technic#310

@S-S-X S-S-X closed this as completed Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants