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

Many factory types continue to run when chest is full #25

Open
squareblob opened this issue Jul 17, 2020 · 7 comments
Open

Many factory types continue to run when chest is full #25

squareblob opened this issue Jul 17, 2020 · 7 comments

Comments

@squareblob
Copy link

This is fixed for compactors (#13). Other factory types, such as production factories, will continue to run and in the process waste output. It would reduce annoyance (particularly for new players) if all factories automatically deactivated when insufficient output storage space exists.

@Maxopoly Maxopoly added bug Something isnt working D3 - basic issue labels Jul 19, 2020
@Inframission
Copy link

Inframission commented Jul 23, 2020

This is also a bug with current 'working' factories.
At least some of the time compactors will continue running and delete stacks.
When this happens the factory can still be started even when the chest is full.

@Maxopoly
Copy link
Member

Fixed by #27 for production recipes, remains an open issue for other types.

@Falvyu
Copy link

Falvyu commented Jul 26, 2020

This is also a bug with current 'working' factories.
At least some of the time compactors will continue running and delete stacks.
When this happens the factory can still be started even when the chest is full.

Weird, that's not supposed to happen for compactors. Try to decompact materials when the compactor is full stops the compactor and does not consume any item.
Are you able to reproduce it ?

@Inframission
Copy link

Try to decompact materials when the compactor is full stops the compactor and does not consume any item.

Yes, compactors are still affected.
See https://gfycat.com/frigidwaterloggedgrosbeak

@Falvyu
Copy link

Falvyu commented Aug 8, 2020

Alright, I think I've found the issue.

The "fix" to factories relies on the fitsIn(Inventory) method. This method works as follows:

  1. A "fictive" inventory (invCopy) is created
  2. All the items from the given inventory are added to it using the addItemStack() method
  3. The item stack is then added into it.
  4. If the size exceeds the original one then that means that the item stack doesn't fit.

This might seems fine at first. However step 2 will stack the item and will "defragment" the given inventory.

Thus, if we give this inventory as a parameter: Input

The representation will be: Output

Since the representation has 1 available slot, the fitsIn() function will return true and the factory will still execute the recipe.

I think there are 2 "basic" solutions to that:

  • "Fix" fitsIn() but that introduces a regression in CMC

  • Make a new function for that purpose.

Either choice shouldn't be too hard to implement. But I'm curious to hear which one @Maxopoly prefers.

@Maxopoly
Copy link
Member

Maxopoly commented Aug 8, 2020

Fix fitsIn(), it was made with this use case in mind.

@Diet-Cola
Copy link

Is this still an issue? Can't seem to replicate on test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants