a
This commit is contained in:
parent
fdc9944c17
commit
18949d65c4
@ -335,10 +335,13 @@ class EnergyCableGraph : GraphNodeList<EnergyCableBlockEntity.Node, EnergyCableG
|
|||||||
v.segment.transferredLastTick = transferredLastTick
|
v.segment.transferredLastTick = transferredLastTick
|
||||||
v.segment.lastPoweredStatus = lastPoweredStatus
|
v.segment.lastPoweredStatus = lastPoweredStatus
|
||||||
v.segment.paths = paths.clone()
|
v.segment.paths = paths.clone()
|
||||||
|
|
||||||
paths.forEach { it.segments.add(v.segment) }
|
paths.forEach { it.segments.add(v.segment) }
|
||||||
|
|
||||||
result.add(v.segment)
|
result.add(v.segment)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paths.forEach { it.nodes.addAll(nodes) }
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -493,7 +496,7 @@ class EnergyCableGraph : GraphNodeList<EnergyCableBlockEntity.Node, EnergyCableG
|
|||||||
var maxThroughput = list.paths.maxOfOrNull { it.availableThroughput } ?: Decimal.ZERO
|
var maxThroughput = list.paths.maxOfOrNull { it.availableThroughput } ?: Decimal.ZERO
|
||||||
var combinedThroughput = list.paths.iterator().map { it.availableThroughput }.reduce(Decimal.ZERO, Decimal::plus)
|
var combinedThroughput = list.paths.iterator().map { it.availableThroughput }.reduce(Decimal.ZERO, Decimal::plus)
|
||||||
|
|
||||||
while (combinedThroughput < energyToTransfer && !list.saturated && ++lastTickSearches <= maxSearches) {
|
while (maxThroughput < energyToTransfer && !list.saturated && ++lastTickSearches <= maxSearches) {
|
||||||
val find = findPath(a, b, list.paths, maxThroughput)
|
val find = findPath(a, b, list.paths, maxThroughput)
|
||||||
|
|
||||||
if (find == null || find in list.paths) {
|
if (find == null || find in list.paths) {
|
||||||
|
Loading…
Reference in New Issue
Block a user