Compare commits

..

2 Commits

Author SHA1 Message Date
Shadowfacts a88eda357c
Improve Miner handling of excess items 2021-02-17 23:03:21 -05:00
Shadowfacts 7034ce11ef
Fix ConcurrentModificationExceptions 2021-02-17 23:03:15 -05:00
2 changed files with 2 additions and 2 deletions

View File

@ -164,8 +164,8 @@ class TerminalBlockEntity: DeviceBlockEntity(PhyBlockEntities.TERMINAL),
if (pendingRequests.isEmpty()) return
val finishable = pendingRequests.filter { it.isFinishable(counter) }
// stackLocateRequestCompleted removes the object from pendingRequests
finishable.forEach(::stackLocateRequestCompleted)
pendingRequests.removeAll(finishable)
}
fun addObserver() {

View File

@ -75,7 +75,7 @@ fun <Self, Insertion: NetworkStackDispatcher.PendingInsertion<Insertion>> Self.f
if (pendingInsertions.isEmpty()) return
val finishable = pendingInsertions.filter { it.isFinishable(this) }
// finishInsertion removes the object from pendingInsertions
finishable.forEach(::finishInsertion)
pendingInsertions.removeAll(finishable)
// todo: if a timed-out insertion can't be finished, we should probably retry after some time (exponential backoff?)
}