Compare commits
2 Commits
d743f8f2b2
...
8d1c2854f6
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 8d1c2854f6 | |
Shadowfacts | bae2a32cb0 |
|
@ -161,11 +161,12 @@ class TerminalBlockEntity: DeviceBlockEntity(PhyBlockEntities.TERMINAL),
|
|||
|
||||
private fun finishPendingRequests() {
|
||||
if (world!!.isClient) return
|
||||
if (pendingRequests.isEmpty()) return
|
||||
|
||||
val finishable = pendingRequests.filter { it.isFinishable(counter) }
|
||||
finishable.forEach(::stackLocateRequestCompleted)
|
||||
pendingRequests.removeAll(finishable)
|
||||
for (request in pendingRequests) {
|
||||
if (request.isFinishable(counter)) {
|
||||
stackLocateRequestCompleted(request)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun addObserver() {
|
||||
|
|
|
@ -72,10 +72,9 @@ 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
|
||||
|
||||
val finishable = pendingInsertions.filter { it.isFinishable(this) }
|
||||
finishable.forEach(::finishInsertion)
|
||||
pendingInsertions.removeAll(finishable)
|
||||
pendingInsertions
|
||||
.filter { it.isFinishable(this) }
|
||||
.forEach(::finishInsertion)
|
||||
// todo: if a timed-out insertion can't be finished, we should probably retry after some time (exponential backoff?)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue