diff --git a/src/main/kotlin/net/shadowfacts/phycon/network/component/NetworkStackDispatcher.kt b/src/main/kotlin/net/shadowfacts/phycon/network/component/NetworkStackDispatcher.kt index d193ad7..818e5fc 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/network/component/NetworkStackDispatcher.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/network/component/NetworkStackDispatcher.kt @@ -73,8 +73,8 @@ interface NetworkStackDispatcher> Self.finishTimedOutPendingInsertions() where Self: BlockEntity, Self: NetworkStackDispatcher { if (world!!.isClient) return - for (insertion in pendingInsertions) { - if (!insertion.isFinishable(this)) continue - finishInsertion(insertion) - } + 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?) }