Fixed bug where Crafting Upgrade on Interface kept too many items in stock. Fixes #1725

This commit is contained in:
raoulvdberge
2018-06-19 22:39:43 +02:00
parent e37168d172
commit 362acea5c4
2 changed files with 7 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ NOTE: Worlds that used Refined Storage 1.5.x are fully compatible with Refined S
- Fixed a crash when breaking an Ender IO conduit with the Destructor (raoulvdberge)
- Fixed bug where storage disks in Portable Grids could be moved into themselves (raoulvdberge)
- Fixed the Crafter crashing when opening it while connected to a Primal Tech Grill or Kiln (raoulvdberge)
- Fixed bug where Crafting Upgrade on Interface kept too many items in stock (raoulvdberge)
- Prevent accidental Grid scrollbar click after clicking JEI recipe transfer button (raoulvdberge)
- Added a missing config option for Crafter Manager energy usage (raoulvdberge)
- If an Interface is configured to expose the entire network storage (by configuring no export slots), it will no longer expose the entire RS storage, due to performance issues (raoulvdberge)

View File

@@ -196,13 +196,15 @@ public class CraftingManager implements ICraftingManager {
@Nullable
public ICraftingTask schedule(ItemStack stack, int toSchedule) {
for (ICraftingTask task : getTasks()) {
for (ItemStack output : task.getPattern().getOutputs()) {
if (API.instance().getComparer().isEqualNoQuantity(output, stack)) {
toSchedule -= output.getCount() * task.getQuantity();
}
if (API.instance().getComparer().isEqualNoQuantity(task.getRequested(), stack)) {
toSchedule -= task.getQuantity();
}
}
ItemStack existing = network.getItemStorageCache().getList().get(stack);
toSchedule -= existing == null ? 0 : existing.getCount();
if (toSchedule > 0) {
ICraftingTask task = create(stack, toSchedule);