Speed up cable Segment splitting
This commit is contained in:
parent
9579bc6a0c
commit
aa41647c04
@ -307,13 +307,21 @@ class EnergyCableGraph : GraphNodeList<EnergyCableBlockEntity.Node, EnergyCableG
|
||||
result.add(this)
|
||||
|
||||
for (v in itr) {
|
||||
v.segment = Segment()
|
||||
v._segment = Segment()
|
||||
v.segment.nodes.add(v)
|
||||
v.segment.throughput = v.energyThroughput
|
||||
v.segment.throughputKnown = true
|
||||
v.segment.transferredLastTick = transferredLastTick
|
||||
v.segment.paths.addAll(paths)
|
||||
paths.forEach { it.segments.add(v.segment) }
|
||||
result.add(v.segment)
|
||||
}
|
||||
|
||||
nodes.clear()
|
||||
nodes.add(list[0])
|
||||
throughput = list[0].energyThroughput
|
||||
throughputKnown = true
|
||||
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user