From eeea5377151fe14a424ad272180be8de52ea2806 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 15 Jan 2025 21:53:33 +0700 Subject: [PATCH] Fix splitted segments getting attached to unrelated paths --- .../dbotthepony/mc/otm/block/entity/cable/EnergyCableGraph.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/cable/EnergyCableGraph.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/cable/EnergyCableGraph.kt index 930d6e13b..44d87611f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/cable/EnergyCableGraph.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/cable/EnergyCableGraph.kt @@ -399,7 +399,7 @@ class EnergyCableGraph : GraphNodeList() solution.forEach { touchedSegments.addAll(it.segment.split()) } 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) }