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
|
var transferredLastTick = Decimal.ZERO
|
||||||
private set
|
private set
|
||||||
|
|
||||||
val availableThroughput: Decimal
|
val availableThroughput: Decimal get() {
|
||||||
get() = throughput - transferredLastTick
|
if (!throughputKnown) {
|
||||||
|
throughput = nodes.maxOf { it.energyThroughput }
|
||||||
|
throughputKnown = true
|
||||||
|
}
|
||||||
|
|
||||||
|
return throughput - transferredLastTick
|
||||||
|
}
|
||||||
|
|
||||||
private var throughputKnown = false
|
private var throughputKnown = false
|
||||||
private var lastTick = 0
|
private var lastTick = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user