Fix splitted segments getting attached to unrelated paths
This commit is contained in:
parent
bd4fe17e33
commit
eeea537715
@ -399,7 +399,7 @@ class EnergyCableGraph : GraphNodeList<EnergyCableBlockEntity.Node, EnergyCableG
|
|||||||
val touchedSegments = ReferenceArraySet<Segment>()
|
val touchedSegments = ReferenceArraySet<Segment>()
|
||||||
solution.forEach { touchedSegments.addAll(it.segment.split()) }
|
solution.forEach { touchedSegments.addAll(it.segment.split()) }
|
||||||
val path = SegmentPath(a.blockEntity.blockPos, b.blockEntity.blockPos)
|
val path = SegmentPath(a.blockEntity.blockPos, b.blockEntity.blockPos)
|
||||||
touchedSegments.forEach { it.add(path) }
|
solution.forEach { it.segment.add(path) }
|
||||||
|
|
||||||
touchedSegments.forEach { it.tryCombine(touchedSegments) }
|
touchedSegments.forEach { it.tryCombine(touchedSegments) }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user