Fix ConcurrentModificationException when attempting to finish timed out insertions
This commit is contained in:
parent
6a06ef6ae0
commit
bae2a32cb0
|
@ -73,8 +73,8 @@ interface NetworkStackDispatcher<Insertion: NetworkStackDispatcher.PendingInsert
|
|||
fun <Self, Insertion: NetworkStackDispatcher.PendingInsertion<Insertion>> Self.finishTimedOutPendingInsertions() where Self: BlockEntity, Self: NetworkStackDispatcher<Insertion> {
|
||||
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?)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue