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

@@ -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);