Compare commits
2 Commits
8d1c2854f6
...
d743f8f2b2
Author | SHA1 | Date |
---|---|---|
Shadowfacts | d743f8f2b2 | |
Shadowfacts | b6f43966f4 |
|
@ -161,12 +161,11 @@ class TerminalBlockEntity: DeviceBlockEntity(PhyBlockEntities.TERMINAL),
|
|||
|
||||
private fun finishPendingRequests() {
|
||||
if (world!!.isClient) return
|
||||
if (pendingRequests.isEmpty()) return
|
||||
|
||||
for (request in pendingRequests) {
|
||||
if (request.isFinishable(counter)) {
|
||||
stackLocateRequestCompleted(request)
|
||||
}
|
||||
}
|
||||
val finishable = pendingRequests.filter { it.isFinishable(counter) }
|
||||
finishable.forEach(::stackLocateRequestCompleted)
|
||||
pendingRequests.removeAll(finishable)
|
||||
}
|
||||
|
||||
fun addObserver() {
|
||||
|
|
|
@ -72,9 +72,10 @@ interface NetworkStackDispatcher<Insertion: NetworkStackDispatcher.PendingInsert
|
|||
|
||||
fun <Self, Insertion: NetworkStackDispatcher.PendingInsertion<Insertion>> Self.finishTimedOutPendingInsertions() where Self: BlockEntity, Self: NetworkStackDispatcher<Insertion> {
|
||||
if (world!!.isClient) return
|
||||
if (pendingInsertions.isEmpty()) return
|
||||
|
||||
pendingInsertions
|
||||
.filter { it.isFinishable(this) }
|
||||
.forEach(::finishInsertion)
|
||||
val finishable = pendingInsertions.filter { it.isFinishable(this) }
|
||||
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?)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue