From 614ba26da6e478fc4d158a077f652ffdc103fb69 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 11 Feb 2025 00:17:04 +0700 Subject: [PATCH] Improve extra path search performance --- .../mc/otm/block/entity/cable/EnergyCableGraph.kt | 8 +++++++- 1 file changed, 7 insertions(+), 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 5f2de56ea..81525d3db 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 @@ -9,6 +9,7 @@ import ru.dbotthepony.mc.otm.SERVER_IS_LIVE import ru.dbotthepony.mc.otm.UNIVERSE_TICKS import ru.dbotthepony.mc.otm.capability.receiveEnergy import ru.dbotthepony.mc.otm.config.CablesConfig +import ru.dbotthepony.mc.otm.core.addAll import ru.dbotthepony.mc.otm.core.math.Decimal import ru.dbotthepony.mc.otm.core.math.RelativeSide import ru.dbotthepony.mc.otm.core.shuffle @@ -69,6 +70,7 @@ class EnergyCableGraph : GraphNodeList() + val nodes = HashSet() var shortCircuit = false private var lastTickTransfers = 0 private var lastTick = 0 @@ -81,7 +83,7 @@ class EnergyCableGraph : GraphNodeList