Skip to content

Commit d83d01e

Browse files
committed
[Fix]: Fix a bug where Controller blocks would randomly stop inserting items
1 parent 75ea4bc commit d83d01e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Diff for: src/main/java/net/p3pp3rf1y/sophisticatedcore/controller/ControllerBlockEntityBase.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ public long insert(ItemVariant resource, long maxAmount, TransactionContext ctx,
706706
}
707707
}
708708

709-
return (insertIntoAnyEmpty ? insertIntoStorages(emptySlotsStorages, resource, remaining, ctx, false) : maxAmount - remaining);
709+
return maxAmount - (insertIntoAnyEmpty ? insertIntoStorages(emptySlotsStorages, resource, remaining, ctx, false) : remaining);
710710
}
711711

712712
private long insertIntoStoragesThatMatchStack(ItemVariant resource, long maxAmount, ItemStackKey stackKey, TransactionContext ctx) {
@@ -914,9 +914,6 @@ public Iterator<StorageView<ItemVariant>> iterator() {
914914
return new CombinedIterator();
915915
}
916916

917-
/**
918-
* The combined iterator for multiple storages.
919-
*/
920917
private class CombinedIterator implements Iterator<StorageView<ItemVariant>> {
921918
final Iterator<BlockPos> positionIterator = storagePositions.iterator();
922919
// Always holds the next StorageView<T>, except during next() while the iterator is being advanced.

0 commit comments

Comments
 (0)