Compare commits

..

2 Commits

Author SHA1 Message Date
Shadowfacts d743f8f2b2
Improve Miner handling of excess items 2021-02-17 23:01:45 -05:00
Shadowfacts b6f43966f4
Fix ConcurrentModificationExceptions 2021-02-17 23:01:36 -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?)
}