Skip to content

Commit f68e72a

Browse files
committed
Fix #935: Machine output slots getting stuck in an invisible locked state
1 parent 81a7182 commit f68e72a

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/main/java/aztech/modern_industrialization/machines/components/CrafterComponent.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -523,18 +523,19 @@ protected boolean putItemOutputs(MachineRecipe recipe, boolean simulate, boolean
523523
? (int) stack.getRemainingCapacityFor(output.variant())
524524
: output.variant().getMaxStackSize() - (int) stack.getAmount();
525525
int ins = Math.min(remainingAmount, remainingCapacity);
526-
if (key.isBlank()) {
527-
if ((stack.isMachineLocked() || stack.isPlayerLocked() || loopRun == 1) && stack.isValid(output.getStack())) {
528-
stack.setAmount(ins);
529-
stack.setKey(output.variant());
526+
if (ins > 0) {
527+
if (key.isBlank()) {
528+
if ((stack.isMachineLocked() || stack.isPlayerLocked() || loopRun == 1) && stack.isValid(output.getStack())) {
529+
stack.setAmount(ins);
530+
stack.setKey(output.variant());
531+
} else {
532+
ins = 0;
533+
}
530534
} else {
531-
ins = 0;
535+
stack.increment(ins);
532536
}
533-
} else {
534-
stack.increment(ins);
535-
}
536-
remainingAmount -= ins;
537-
if (ins > 0) {
537+
remainingAmount -= ins;
538+
538539
locksToToggle.add(stackId - 1);
539540
lockItems.add(output.variant().getItem());
540541
if (!simulate) {

0 commit comments

Comments
 (0)