Fix cable path heuristics
This commit is contained in:
parent
07121d8b41
commit
436456dcc5
@ -99,8 +99,14 @@ class EnergyCableGraph : GraphNodeList<EnergyCableBlockEntity.Node, EnergyCableG
|
||||
var transferredLastTick = Decimal.ZERO
|
||||
private set
|
||||
|
||||
val availableThroughput: Decimal
|
||||
get() = throughput - transferredLastTick
|
||||
val availableThroughput: Decimal get() {
|
||||
if (!throughputKnown) {
|
||||
throughput = nodes.maxOf { it.energyThroughput }
|
||||
throughputKnown = true
|
||||
}
|
||||
|
||||
return throughput - transferredLastTick
|
||||
}
|
||||
|
||||
private var throughputKnown = false
|
||||
private var lastTick = 0
|
||||
|
Loading…
Reference in New Issue
Block a user