-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resources not being used up correctly when there are missing items
We always have to add the resulting output resources to the internal storage, even if there are missing resources. If we would not do this, then, in the case of missing resources, it would re-calculate the same ingredient from scratch everytime and use way too much resources. However, if we always add resulting resources, even if there are missing items, we must still use up the yields from the recursive calculation. Otherwise, if we would not use up the yields from the recursive calculation, the crafting calculation would incorrectly use up resources from the internal storage for other ingredients. What is the difference between not adding the yields in case of missing resources and using up the recursive yields when there were missing resources? The difference lies in the fact that, when we do not add *any* yields, the crafting calculation would start from scratch everytime for each ingredient. Only using up what we needed in the first place from the recursive yield ensures that any _leftover_ yields can still be used up by other ingredients that happen to need the same resource. So, the difference lies in not having any yields at all versus still allowing access to the leftovers.
- Loading branch information
1 parent
36bbd76
commit 7cb2e3a
Showing
6 changed files
with
60 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...on/PreviewCraftingCalculatorListener.java → ...ew/PreviewCraftingCalculatorListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
...c/test/java/com/refinedmods/refinedstorage/api/autocrafting/calculation/package-info.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters