From 7a0d7d668af5cd80fd76180eb4c35cea5c9d3349 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 13 Oct 2022 20:21:49 +0700 Subject: [PATCH] Fix endless while loop when machine can't finish work without idle reason --- .../mc/otm/block/entity/MatteryWorkerBlockEntity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryWorkerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryWorkerBlockEntity.kt index aacaa4206..2eddb08dc 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryWorkerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryWorkerBlockEntity.kt @@ -245,7 +245,7 @@ abstract class MatteryWorkerBlockEntity( var availableTicks = 1.0 - while (!isIdling && weakGreaterThan(availableTicks, 0.0)) { + while (!isIdling && weakGreaterThan(availableTicks, 0.0) && throttleTicks <= 0) { if (isBlockedByRedstone) { isIdling = true break @@ -346,6 +346,7 @@ abstract class MatteryWorkerBlockEntity( } errorTicksAnim++ + break } }