Fix weird terminal behavior when inserting multiple equivalent stacks
This commit is contained in:
parent
8dbccc541e
commit
385e36918f
|
@ -29,10 +29,10 @@ interface NetworkStackDispatcher<Insertion: NetworkStackDispatcher.PendingInsert
|
|||
}
|
||||
|
||||
fun handleCapacity(packet: CapacityPacket) {
|
||||
val insertion = pendingInsertions.firstOrNull {
|
||||
ItemStackUtil.areEqualIgnoreAmounts(packet.stack, it.stack)
|
||||
}
|
||||
if (insertion != null) {
|
||||
pendingInsertions.firstOrNull { insertion ->
|
||||
ItemStackUtil.areEqualIgnoreAmounts(packet.stack, insertion.stack) &&
|
||||
insertion.results.none { it.second.ipAddress == packet.source }
|
||||
}?.also { insertion ->
|
||||
insertion.results.add(packet.capacity to packet.stackReceiver)
|
||||
if (insertion.isFinishable(this)) {
|
||||
val remaining = finishInsertion(insertion)
|
||||
|
|
Loading…
Reference in New Issue