From b9d85b7b17a88a684cfebed955f94f168dbb1fed Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 7 Feb 2025 21:43:53 +0700 Subject: [PATCH] Replace exception with "short circuit" flag on cables --- .../mc/otm/block/entity/cable/EnergyCableGraph.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 b7fefc158..a5fde294b 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 @@ -68,7 +68,7 @@ class EnergyCableGraph : GraphNodeList() - private var shortCircuit = false + var shortCircuit = false private var lastTickTransfers = 0 private var lastTick = 0 @@ -516,6 +516,7 @@ class EnergyCableGraph : GraphNodeList Decimal.ZERO) { + LOGGER.warn("Cable path from $fromNode to $node doesn't follow common sense, disabling.") + paths.forEach { it.shortCircuit = true } + } } }